mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Don't remove empty patterns with inheritance
This commit is contained in:
@ -24,6 +24,7 @@ var container = require('./_collections').elemsGroups.container;
|
|||||||
*/
|
*/
|
||||||
exports.fn = function(item) {
|
exports.fn = function(item) {
|
||||||
|
|
||||||
return !(item.isElem(container) && !item.isElem('svg') && item.isEmpty());
|
return !(item.isElem(container) && !item.isElem('svg') && item.isEmpty() &&
|
||||||
|
(!item.isElem('pattern') || !item.hasAttr('xlink:href')));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<pattern/>
|
||||||
<g>
|
<g>
|
||||||
<marker>
|
<marker>
|
||||||
<a/>
|
<a/>
|
||||||
|
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 226 B |
@ -1,4 +1,10 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<pattern id="a">
|
||||||
|
<rect/>
|
||||||
|
</pattern>
|
||||||
|
<pattern xlink:href="url(#a)" id="b"/>
|
||||||
|
</defs>
|
||||||
<g>
|
<g>
|
||||||
<marker>
|
<marker>
|
||||||
<a/>
|
<a/>
|
||||||
@ -9,7 +15,13 @@
|
|||||||
|
|
||||||
@@@
|
@@@
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<pattern id="a">
|
||||||
|
<rect/>
|
||||||
|
</pattern>
|
||||||
|
<pattern xlink:href="url(#a)" id="b"/>
|
||||||
|
</defs>
|
||||||
<g>
|
<g>
|
||||||
<path d="..."/>
|
<path d="..."/>
|
||||||
</g>
|
</g>
|
||||||
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 590 B |
Reference in New Issue
Block a user