Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glimmer converts html entities to equivalent chars during AST generation. #833

Closed
siva-sundar opened this issue Jun 21, 2018 · 3 comments
Closed

Comments

@siva-sundar
Copy link

Html entities like '&times;', '&lt;', '&gt;' are converted to ×, <, > during AST generation. This leads to a problem while during hbs transformations.

Here is the reproduction demo.

@Turbo87
Copy link
Member

Turbo87 commented Jun 21, 2018

@siva-sundar the glimmer parser creates an abstract syntax tree, not a concrete syntax tree (see https://eli.thegreenplace.net/2009/02/16/abstract-vs-concrete-syntax-trees/), so this is somewhat intended.

you will most likely have to convert those entities back to their escaped values when you pretty print the HBS code

@siva-sundar
Copy link
Author

@Turbo87 Thanks

@GavinJoyce
Copy link
Contributor

@siva-sundar did you happen to solve this by doing the replacement after printing? If so, perhaps you could point out where that code lives? We'd like to do this in the ember-angle-brackets-codemod too: https://github.com/rajasegar/ember-angle-brackets-codemod/issues/48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants