Skip to content

Commit

Permalink
fix: treat ?? in processing instructions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Jul 6, 2018
1 parent 45047ae commit bc1e1d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@ class SAXParser {
this.piTarget = this.piBody = "";
this.state = S_TEXT;
}
else if (c === "?") {
// We ran into ?? as part of a processing instruction. We initially
// took the first ? as a sign that the PI was ending, but it is
// not. So we have to add it to the body but we take the new ? as a
// sign that the PI is ending.
this.piBody += "?";
}
else {
this.piBody += `?${c}`;
this.state = S_PI_BODY;
Expand Down

0 comments on commit bc1e1d4

Please sign in to comment.