Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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*/);
match(/\?>\s*<\?.*?\?>/);

return node;
}
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ it('should support declarations', function(){
})
})

it('should ignore stylesheet declarations', function(){
var node = parse('<?xml version="1.0" ?><?xml-stylesheet title="XSL_formatting"?><foo></foo><?xml version="1.0" ?>');
should.exist(node.root);
})

it('should support comments', function(){
var node = parse('<!-- hello --><foo></foo><!-- world -->');
node.root.should.eql({
Expand Down