Skip to content

Commit

Permalink
fix(removeEmptyContainers): don't remove empty containers if parent i…
Browse files Browse the repository at this point in the history
…s switch (#1747)
  • Loading branch information
vincentbernat authored Nov 29, 2023
1 parent 8dd7a3b commit f0ec586
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/removeEmptyContainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ exports.fn = () => {
if (node.name === 'mask' && node.attributes.id != null) {
return;
}
if (parentNode.type === 'element' && parentNode.name === 'switch') {
return;
}
detachNodeFromParent(node, parentNode);
},
},
Expand Down
25 changes: 25 additions & 0 deletions test/plugins/removeEmptyContainers.06.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 f0ec586

Please sign in to comment.