1
0
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:
GreLI
2015-01-25 20:00:40 +03:00
parent 35d351a15e
commit 290d610f27
2 changed files with 10 additions and 3 deletions

View File

@ -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);
})