mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
This commit is contained in:
@ -5,7 +5,7 @@ exports.type = 'perItem';
|
|||||||
exports.active = true;
|
exports.active = true;
|
||||||
|
|
||||||
var inheritableAttrs = require('./_collections').inheritableAttrs,
|
var inheritableAttrs = require('./_collections').inheritableAttrs,
|
||||||
presentationAttrs = require('./_collections').attrsGroups.presentation,
|
attrsGroups = require('./_collections').attrsGroups,
|
||||||
excludedAttrs = ['display', 'opacity'];
|
excludedAttrs = ['display', 'opacity'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,9 +22,12 @@ exports.fn = function(item) {
|
|||||||
|
|
||||||
item.eachAttr(function(attr) {
|
item.eachAttr(function(attr) {
|
||||||
if (
|
if (
|
||||||
presentationAttrs.indexOf(attr.name) !== -1 &&
|
~attrsGroups.presentation.indexOf(attr.name) &&
|
||||||
excludedAttrs.indexOf(attr.name) === -1 &&
|
~attrsGroups.graphicalEvent.indexOf(attr.name) &&
|
||||||
inheritableAttrs.indexOf(attr.name) === -1
|
~attrsGroups.core.indexOf(attr.name) &&
|
||||||
|
~attrsGroups.conditionalProcessing.indexOf(attr.name) &&
|
||||||
|
!~excludedAttrs.indexOf(attr.name) &&
|
||||||
|
!~inheritableAttrs.indexOf(attr.name)
|
||||||
) {
|
) {
|
||||||
item.removeAttr(attr.name);
|
item.removeAttr(attr.name);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@@@
|
@@@
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
<g class="test" transform="rotate(45)" display="none" opacity="0.5" visibility="visible">
|
<g class="test" clip-path="url(#clip1)" transform="rotate(45)" display="none" opacity="0.5" visibility="visible">
|
||||||
<path d="M0 0 L 10 20"/>
|
<path d="M0 0 L 10 20"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 422 B |
Reference in New Issue
Block a user