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

Keep whitespace in ProcessingInstruction's data field #212

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Holzhaus
Copy link

This fixes Processing Instruction parsing (except for the XML declaration problem, which is fixed by #209), so that whitespace won't be stripped.

Details: https://www.w3.org/TR/2008/REC-xml-20081126/#sec-pi

Holzhaus added 6 commits June 12, 2017 00:01
If you have a look at the actual definition of a Processing instruction
in the XML spec, you'll see that there's no asterisk after the
Whitespace ("S") in the production rule.

[16] PI := '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
According to the XML 1.0 spec, Prod. rule [3], whitespace (S) can also
consist of multiple characters.

I verified this in Firefox and Chromium -- both trim leading whitespace
of the PIData section.
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

Successfully merging this pull request may close these issues.

1 participant