From 95f7603983d50aa579b6ebb21fa747d0436e5581 Mon Sep 17 00:00:00 2001 From: GreLI Date: Sun, 19 May 2019 20:44:36 +0300 Subject: [PATCH] Fix removeUnusedNS not counting usage in tag Close #1107 --- plugins/removeUnusedNS.js | 4 +++- test/plugins/removeUnusedNS.07.svg | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/plugins/removeUnusedNS.07.svg diff --git a/plugins/removeUnusedNS.js b/plugins/removeUnusedNS.js index c4787915..db0df760 100644 --- a/plugins/removeUnusedNS.js +++ b/plugins/removeUnusedNS.js @@ -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) { diff --git a/test/plugins/removeUnusedNS.07.svg b/test/plugins/removeUnusedNS.07.svg new file mode 100644 index 00000000..1ee5350a --- /dev/null +++ b/test/plugins/removeUnusedNS.07.svg @@ -0,0 +1,9 @@ + + test + + +@@@ + + + test +