Skip to content

Commit

Permalink
Don't remove empty patterns with inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Apr 12, 2015
1 parent f651fd8 commit d0a5d0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plugins/removeEmptyContainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var container = require('./_collections').elemsGroups.container;
*/
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 change: 1 addition & 0 deletions test/plugins/removeEmptyContainers.01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions test/plugins/removeEmptyContainers.02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0a5d0e

Please sign in to comment.