1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Fix removeUnusedNS not counting usage in <svg> tag

Close #1107
This commit is contained in:
GreLI
2019-05-19 20:44:36 +03:00
parent 5f70831868
commit 95f7603983
2 changed files with 12 additions and 1 deletions

View File

@ -66,7 +66,9 @@ exports.fn = function(data) {
svgElem = item;
}
} else if (xmlnsCollection.length) {
}
if (xmlnsCollection.length) {
// check item for the ns-attrs
if (item.prefix) {

View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" sodipodi:docname="test.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd">
test
</svg>
@@@
<svg xmlns="http://www.w3.org/2000/svg" inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" sodipodi:docname="test.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd">
test
</svg>

After

Width:  |  Height:  |  Size: 530 B