ml_parser - leading '&#' leads to a cryptic error
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
Any attribute value with an leading &#
will throw:
Template parse errors:
Unexpected character "'" ("<hello name="{{ name }}" [icon]="'&#[ERROR ->]'"></hello>
<p>
Start editing to see some magic happen :)
"): ng:///AppModule/AppComponent.html@0:36
Unexpected closing tag "hello". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags ("<hello name="{{ name }}" [icon]="'&#'">[ERROR ->]</hello>
<p>
Start editing to see some magic happen :)
"): ng:///AppModule/AppComponent.html@0:39
Evaluating src/main.ts
Booting application
Expected behavior
- The parser should point to the exact issue that an entity was expected. The error message here should be more meaningful. or
- The parser should proceed and handle it as text because parser can’t know if it’s an entity. or
- or Handle e.g
ō
asō
that’s the behaviour of parse5
But we can definitly improve the error message.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-fjgsqz?file=src/app/app.component.html
What is the motivation / use case for changing the behavior?
User should get the correct error message
Environment
Angular version: 6.0.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
XML Parser Error Codes - IBM
XML Parser Error Codes ; 2, The parser found an invalid start of a processing instruction, element, comment, or document type declaration outside...
Read more >XML document must have a top level element" error message ...
You receive an "XML Parser Error: XML document must have a top level element" error message when you try to assign a record...
Read more >Practical XML: Parsing - kdgregory.com
Describes how to use the JDK's DOM parser, including validation using both DTD and XML Schema.
Read more >Cryptic "Script Error." reported in Javascript in Chrome and ...
The "Script error." happens in Firefox, Safari, and Chrome when an exception violates the browser's same-origin policy - i.e. when the error ...
Read more >Error pushing -meta.xml to scratch org: The processing ...
There is an empty line / blank space before the XML prolog. Clearing out everything before the <xml version... resolved the somewhat cryptic...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@StarpTech
I have never said the error message is good 😏
Per html definition, anything that starts with an ampersand is an entity. If you want to output one you should use
&
.If you use the correct syntax it works:
ō