diff --git a/plugins/cleanupIds.js b/plugins/cleanupIds.js index c113db283..671a85248 100644 --- a/plugins/cleanupIds.js +++ b/plugins/cleanupIds.js @@ -13,7 +13,7 @@ exports.description = 'removes unused IDs and minifies used'; const regReferencesUrl = /\burl\((["'])?#(.+?)\1\)/g; const regReferencesHref = /^#(.+?)$/; -const regReferencesBegin = /(\D+)\./; +const regReferencesBegin = /(\w+)\.[a-zA-Z]/; const generateIdChars = [ 'a', 'b', diff --git a/test/plugins/cleanupIds.24.svg b/test/plugins/cleanupIds.24.svg new file mode 100644 index 000000000..26de623c1 --- /dev/null +++ b/test/plugins/cleanupIds.24.svg @@ -0,0 +1,24 @@ +Properly rename IDs, by matching them properly (exclude semicolons, include numbers) +See https://github.com/svg/svgo/issues/1775 + +=== + + + + + + + + + + +@@@ + + + + + + + + + \ No newline at end of file