Skip to content

Commit

Permalink
fix: report processing instructions that do not have a target
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Jul 6, 2018
1 parent 3b508e9 commit c007e39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ class SAXParser {

case S_PI_ENDING:
if (c === ">") {
if (this.piTarget.trim() === "") {
this.fail("Processing instruction without a target");
}
this.emitNode("onprocessinginstruction", {
target: this.piTarget,
body: this.piBody,
Expand Down

0 comments on commit c007e39

Please sign in to comment.