{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jsx/issues/4","labels_url":"https://api.github.com/repos/facebook/jsx/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jsx/issues/4/comments","events_url":"https://api.github.com/repos/facebook/jsx/issues/4/events","html_url":"https://github.com/facebook/jsx/issues/4","id":41513082,"number":4,"title":"Document parsing of (X)HTML entities, or drop it even?","user":{"login":"syranide","id":1714255,"avatar_url":"https://avatars.githubusercontent.com/u/1714255?v=3","gravatar_id":"","url":"https://api.github.com/users/syranide","html_url":"https://github.com/syranide","followers_url":"https://api.github.com/users/syranide/followers","following_url":"https://api.github.com/users/syranide/following{/other_user}","gists_url":"https://api.github.com/users/syranide/gists{/gist_id}","starred_url":"https://api.github.com/users/syranide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syranide/subscriptions","organizations_url":"https://api.github.com/users/syranide/orgs","repos_url":"https://api.github.com/users/syranide/repos","events_url":"https://api.github.com/users/syranide/events{/privacy}","received_events_url":"https://api.github.com/users/syranide/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2014-08-29T15:40:13Z","updated_at":"2015-09-03T10:17:54Z","closed_at":null,"body":"We should probably document how (X)HTML entities are parsed.\r\n\r\nHowever, I can imagine dropping HTML entities instead and adopt the escaping used by JS-strings, i.e. `bla \\< \\{ \\u1234 bla`. To me it would make sense in many ways:\r\n\r\n1. JSX is the JavaScript-equivalent of HTML (it's not HTML), using JavaScript syntax seems preferable.\r\n2. JSX explicitly disallows inline HTML in-favor of just JSXElements and JSXText, HTML entities seem a bit malplaced in that context.\r\n3. It's currently `<a href=\"&amp;\\\" />` vs `<a href={'&\\\\'} />` which is kind of awkward.\r\n\r\nThe downside of dropping HTML entities is obviously that you wouldn't be able to copy-paste HTML and it could be a mental disconnect for a lot of users. But I think it makes a lot of sense from a technical perspective.\r\n\r\nI think it makes even more sense if you look beyond HTML. Why would you be using HTML entities for non-HTML frontends? Like iOS, QT, etc."},"comment":{"url":"https://api.github.com/repos/facebook/jsx/issues/comments/137401484","html_url":"https://github.com/facebook/jsx/issues/4#issuecomment-137401484","issue_url":"https://api.github.com/repos/facebook/jsx/issues/4","id":137401484,"user":{"login":"RReverser","id":557590,"avatar_url":"https://avatars.githubusercontent.com/u/557590?v=3","gravatar_id":"","url":"https://api.github.com/users/RReverser","html_url":"https://github.com/RReverser","followers_url":"https://api.github.com/users/RReverser/followers","following_url":"https://api.github.com/users/RReverser/following{/other_user}","gists_url":"https://api.github.com/users/RReverser/gists{/gist_id}","starred_url":"https://api.github.com/users/RReverser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RReverser/subscriptions","organizations_url":"https://api.github.com/users/RReverser/orgs","repos_url":"https://api.github.com/users/RReverser/repos","events_url":"https://api.github.com/users/RReverser/events{/privacy}","received_events_url":"https://api.github.com/users/RReverser/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T10:17:54Z","updated_at":"2015-09-03T10:17:54Z","body":"> to be honest I'm quite sure that many don't even realize this difference exists\r\n\r\nDunno, maybe, but didn't meet such people yet. Right now it's pretty balanced in sense that most realize that `{...}` is boundaries of JavaScript, outside of them everything works pretty much as XML, inside - as JS.\r\n\r\nThe biggest benefit of entities is that they're properly named and easy to remember. Most people know perfectly how to write `&nbsp;` or `&mdash;` or `&copy;` to get what they want, while very few people know corresponding hexademical codes, and googling them every time you want special character or using some external library that would just provide list of characters is not a really pleasant experience."}}