1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Fixed removing id with quoted reference. Fixes #372

This commit is contained in:
GreLI
2015-06-21 17:15:44 +03:00
parent 4a89a0a98c
commit b5d4166fa9

View File

@ -13,7 +13,7 @@ exports.params = {
};
var referencesProps = require('./_collections').referencesProps,
regReferencesUrl = /^url\(#(.+?)\)$/,
regReferencesUrl = /^url\(("|')?#(.+?)\1\)$/,
regReferencesHref = /^#(.+?)$/,
styleOrScript = ['style', 'script'],
generateIDchars = [
@ -74,10 +74,10 @@ exports.fn = function(data, params) {
match = attr.value.match(regReferencesUrl);
if (match) {
if (referencesIDs[idPrefix + match[1]]) {
referencesIDs[idPrefix + match[1]].push(attr);
if (referencesIDs[idPrefix + match[2]]) {
referencesIDs[idPrefix + match[2]].push(attr);
} else {
referencesIDs[idPrefix + match[1]] = [attr];
referencesIDs[idPrefix + match[2]] = [attr];
}
}
}