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

Consider adding the HTML entities from w3scools #5546

Closed
Tragetaschen opened this issue Dec 2, 2015 · 11 comments
Closed

Consider adding the HTML entities from w3scools #5546

Tragetaschen opened this issue Dec 2, 2015 · 11 comments

Comments

@Tragetaschen
Copy link
Contributor

I picked up 2.0.0-alpha.47 and immediately stumbled over en exception that © was an unknown entity, but w3scools as the top link of a search contained that entity.

Consider adding at least those entities from w3schools to the list

@0x-r4bbit
Copy link
Contributor

@Tragetaschen could you provide a plunk that demonstrates the error?

How about sending a PR to fix this? :)

@Tragetaschen
Copy link
Contributor Author

Whoops, I just realized the error message actually contains the hint…

@Tragetaschen
Copy link
Contributor Author

Going through my application, I stumble upon more occurrences. This is a rather frustrating uphill battle :-/

Plunkr: http://plnkr.co/edit/aWRgOIg6cGhrgeXVxcut?p=preview

I really get the argument for keeping the list and thus the file size small, but I also have to tell my web designer colleague that he cannot use the HTML entities he knows.

@0x-r4bbit
Copy link
Contributor

Correct:

Unknown entity "copy" - use the "&#<decimal>;" or  "&#x<hex>;" syntax ("<div>[ERROR ->]&copy;&euro;&times;</div>")

says that you need to use either the decimal or hexadecimal representation of the html entity. I'm sure there's a reason why alphabetic representations aren't supported. Angular has now its own HTML parser, maybe this is to support more entities instead of maintaining all possible alphabetic version.

Maybe @vsavkin can tell what the reasoning is.

@jnizet
Copy link
Contributor

jnizet commented Dec 3, 2015

I just had that problem too. I understand that this looks to be a feature and not a bug, but it is very disappointing.

Angular is supposed to be "HTML enhanced for web apps!", and this clearly does not enhance HTML.

Not only &times; or &quot; are valid HTML, but they're also much easier to remember, read, understand and maintain than &#215; and &#34;.

So, I just hope this is a temporary limitation, and not a final feature. Can anyone from the team confirm?

@vicb
Copy link
Contributor

vicb commented Dec 3, 2015

The reasoning is that we want to keep the parser size reasonable. The table of all entities would probably be bigger than the parser itself.

That being said, we are open to adding the most common ones.

@pkozlowski-opensource
Copy link
Member

That being said, we are open to adding the most common ones.

Awesome, this is what i wanted to suggest 👍

And as soon as we gain offline compilation super-powers the parser size will be less of a concern

@0x-r4bbit
Copy link
Contributor

Yes, sounds very good to me too! Although "most common ones" can be very relative to everyone. How can we get stats about this?

@vicb
Copy link
Contributor

vicb commented Dec 3, 2015

I'm creating a list based on wikipedia + some other sources, hopefully it will be good enough.

@Tragetaschen
Copy link
Contributor Author

Yay! I skimmed through the list and found the entities I missed before.

JohannesHoppe added a commit to angular-buch/angular2-testing that referenced this issue Dec 6, 2015
…ular#5546

TODO:
- fixed in alpha-48, revert again when upgrading to alpha-48+
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants