mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Limited linking checks to referencing props
This commit is contained in:
@ -4,7 +4,9 @@ exports.type = 'perItem';
|
||||
|
||||
exports.active = true;
|
||||
|
||||
var pathElems = require('./_collections.js').pathElems.slice();
|
||||
var collections = require('./_collections.js'),
|
||||
pathElems = collections.pathElems.slice(),
|
||||
referencesProps = collections.referencesProps;
|
||||
|
||||
pathElems.push('g');
|
||||
pathElems.push('text');
|
||||
@ -35,7 +37,9 @@ exports.fn = function(item) {
|
||||
item.isElem('g') &&
|
||||
item.hasAttr('transform') &&
|
||||
!item.isEmpty() &&
|
||||
!item.someAttr(function(attr) { return ~attr.value.indexOf('url(') }) &&
|
||||
!item.someAttr(function(attr) {
|
||||
return ~referencesProps.indexOf(attr.name) && ~attr.value.indexOf('url(')
|
||||
}) &&
|
||||
item.content.every(function(inner) {
|
||||
return inner.isElem(pathElems);
|
||||
})
|
||||
|
Reference in New Issue
Block a user