mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Allow empty pattern when any attribute is present
This commit is contained in:
@ -24,12 +24,13 @@ var container = require('./_collections').elemsGroups.container;
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*/
|
||||
exports.fn = function(item) {
|
||||
exports.fn = function (item) {
|
||||
return (
|
||||
item.isElem(container) === false ||
|
||||
item.isEmpty() === false ||
|
||||
item.isElem('svg') ||
|
||||
(item.isElem('pattern') && item.hasAttrLocal('href')) ||
|
||||
// empty patterns may contain reusable configuration
|
||||
(item.isElem('pattern') && Object.keys(item.attrs).length !== 0) ||
|
||||
// The 'g' may not have content, but the filter may cause a rectangle
|
||||
// to be created and filled with pattern.
|
||||
(item.isElem('g') && item.hasAttr('filter')) ||
|
||||
|
Reference in New Issue
Block a user