Closed
Description
We should probably document how (X)HTML entities are parsed.
However, 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:
- JSX is the JavaScript-equivalent of HTML (it's not HTML), using JavaScript syntax seems preferable.
- JSX explicitly disallows inline HTML in-favor of just JSXElements and JSXText, HTML entities seem a bit malplaced in that context.
- It's currently
<a href="&\" />
vs<a href={'&\\'} />
which is kind of awkward.
The 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.
I 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.