Skip to content

Commit

Permalink
Fixed dodgy regex
Browse files Browse the repository at this point in the history
 - properly escaped the ?
 - made the . match lazy for safety
 - removed capturing group
  • Loading branch information
Ed Hinchliffe committed Aug 12, 2015
1 parent 4524724 commit cc8bc8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function parse(xml) {
node.attributes[attr.name] = attr.value;
}

match(/\?>\s*(<\?.*\?>)\s*/);
match(/\?>\s*<\?.*?\?>/);

return node;
}
Expand Down

0 comments on commit cc8bc8a

Please sign in to comment.