mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Use first item of few with same ID (as browsers do). Remove subsequent IDs. Resolves #378
This commit is contained in:
@ -67,7 +67,11 @@ exports.fn = function(data, params) {
|
||||
item.eachAttr(function(attr) {
|
||||
// save IDs
|
||||
if (attr.name === 'id') {
|
||||
IDs[idPrefix + attr.value] = item;
|
||||
if (idPrefix + attr.value in IDs) {
|
||||
item.removeAttr('id');
|
||||
} else {
|
||||
IDs[idPrefix + attr.value] = item;
|
||||
}
|
||||
}
|
||||
|
||||
// save IDs url() references
|
||||
|
Reference in New Issue
Block a user