diff --git a/plugins/removeHiddenElems.js b/plugins/removeHiddenElems.js index dba7a3d15..80d4b601f 100644 --- a/plugins/removeHiddenElems.js +++ b/plugins/removeHiddenElems.js @@ -52,7 +52,9 @@ exports.fn = function (item, params) { // https://www.w3schools.com/cssref/pr_class_visibility.asp if ( params.isHidden && - item.hasAttr('visibility', 'hidden') + item.hasAttr('visibility', 'hidden') && + // keep if any descendant enables visibility + item.querySelector('[visibility=visible]') == null ) return false; // display="none" diff --git a/test/plugins/removeHiddenElems.12.svg b/test/plugins/removeHiddenElems.12.svg new file mode 100644 index 000000000..dee42820f --- /dev/null +++ b/test/plugins/removeHiddenElems.12.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + +@@@ + + + + + + + +