Don't treat XML declarations as Processing Instructions#209
Open
Holzhaus wants to merge 2 commits intojindw:masterfrom
Open
Don't treat XML declarations as Processing Instructions#209Holzhaus wants to merge 2 commits intojindw:masterfrom
Holzhaus wants to merge 2 commits intojindw:masterfrom
Conversation
Holzhaus
commented
Jun 11, 2017
sax.js
Outdated
| var end = source.indexOf('?>',start); | ||
| if(end){ | ||
| var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); | ||
| var match = source.substring(start,end).match(/^<\?(\S+)\s*([\s\S]*?)\s*$/); |
Author
There was a problem hiding this comment.
This is another fix that slipped in: The target name of a PI mustn't be empty.
The XML declaration is not a processing instruction.
According to XML 1.0 (5th Edition), Section 2.6, the PI target names "xml",
"XML" and so on are reserved.
Production Rule 17 states:
> PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
This fixes jindw#174.
a359ead to
5f560e2
Compare
|
Just hit this myself. Anything I can do to help get this one merged? The test cases look correct, but let me know if I can help get it ready for release. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XML declarations are not processing instructions.
This fixes #174.
According to XML 1.0 (5th Edition), Section 2.6, the PI target names "xml",
"XML" and so on are reserved.
Production Rule 17 states: