node-xml-stream-parser
Advanced tools
Comparing version
@@ -281,2 +281,5 @@ "use strict"; | ||
} | ||
if (name[name.length - 1] === "/") { | ||
name = name.substr(0, name.length - 1); | ||
} | ||
return { name: name, attributes: attributes }; | ||
@@ -283,0 +286,0 @@ } |
@@ -83,2 +83,3 @@ "use strict"; | ||
p.on("closetag", function (name, attrs) { | ||
console.log(name); | ||
(0, _chai.expect)(name).to.eql("self"); | ||
@@ -91,2 +92,13 @@ (0, _chai.expect)(attrs).to.be.a("object").with.property("___selfClosing___", true); | ||
}); | ||
it("#on(closetag) empty self closing without space.", function (done) { | ||
var p = new _index2.default(); | ||
p.on("closetag", function (name, attrs) { | ||
console.log(name); | ||
(0, _chai.expect)(name).to.eql("self"); | ||
(0, _chai.expect)(attrs).to.be.a("object").with.property("___selfClosing___", true); | ||
}); | ||
p.write("<self />"); | ||
done(); | ||
}); | ||
}); | ||
@@ -93,0 +105,0 @@ |
{ | ||
"name": "node-xml-stream-parser", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "A fast XML parser using streams.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -24,2 +24,3 @@ # node-xml-stream | ||
* Closing tags (closetag) </tag\> | ||
* Self closing tags (closetag) <tag \/\> | ||
* CDATA (cdata) <[[CDATA[data]]> | ||
@@ -30,2 +31,3 @@ * Instructions (instruction) <?xml version="1.0?\> | ||
Important notice due some self closing tags do not have an empty space we strip the last / at the end of a tag name. So if your tag is named somthing/ it will not work. | ||
@@ -117,5 +119,5 @@ ### Installation | ||
### Contributing | ||
Pull requests and stars always welcome. For bugs and feature requests, please [create an issue.](https://github.com/Steeljuice/node-xml-stream/issues) | ||
Pull requests and stars always welcome. For bugs and feature requests, please [create an issue.](https://github.com/mfahlandt/node-xml-stream-parser/issues) | ||
### License | ||
MIT © Tommy Dronkers | ||
MIT |
Sorry, the diff of this file is not supported yet
89998
4.66%418
3.47%121
1.68%