diff --git a/plugins/removeEmptyContainers.js b/plugins/removeEmptyContainers.js index e73ccf7d3..0c1046a65 100644 --- a/plugins/removeEmptyContainers.js +++ b/plugins/removeEmptyContainers.js @@ -32,6 +32,8 @@ exports.fn = function(item) { (item.isElem('pattern') && item.hasAttrLocal('href')) || // 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')) + (item.isElem('g') && item.hasAttr('filter')) || + // empty hides masked element + (item.isElem('mask') && item.hasAttr('id')) ); }; diff --git a/test/plugins/removeEmptyContainers.05.svg b/test/plugins/removeEmptyContainers.05.svg new file mode 100644 index 000000000..793115316 --- /dev/null +++ b/test/plugins/removeEmptyContainers.05.svg @@ -0,0 +1,13 @@ + + + + + + +@@@ + + + + + +