Make entity parsing conform to XML standard #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "entities"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The XML specification says entity references must have a valid identifier as their name. This PR adjusts the grammar to match the specification. The grammar will now produce parse errors when invalidly-named entities are used.
This is not a validator, though. In what way is having error nodes in the tree in this case an improvement over the existing behavior?
It is helpful for syntax highlighting in a text editor, which is where I came across the issue. One could add more special characters to the existing exceptions list to leave something slightly more general (e.g.
&foo\n;and&foo&bar;&foo!bar;are currently accepted as entities, which is quite surprising), but it seems by that point you're already pretty close to the standard anyways.Fair enough. I guess XML is well-defined enough that people aren't using weird dialects that'd be impacted by this. Merged and followed up with
2e8b402