-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support HTML entities in JSX text/attributes
JSX text and attributes support HTML character references (a.k.a. entities), and don't support ECMAScript string escape sequences. Although the [spec] calls it "historical" and threatens to change it, it _is_ in the spec, and the spec is pretty stable at this point. In changing this, I landed back on an idea that @maxbrunsfeld suggested in a [PR review] some time ago: having separate `string` and `jsx_string` nodes, and aliasing `jsx_string` to `string` for consumers' convenience. At that time, having two different node types was deemed unnecessary, but this adds a second, more substantive difference between the two, so I've brought the idea back, and stopped allowing invalid newlines in JS string literals, which is invalid in both JS and TS. [spec]: https://facebook.github.io/jsx/#sec-jsx-string-characters [PR review]: #140 (comment)
- Loading branch information
Showing
2 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters