We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
This transformer will remove any element that doesn't contain any other nodes or non-whitespace text.
lambda {|env| node = env[:node] return unless node.elem? unless node.children.any?{|c| !c.text? || c.content.strip.length > 0 } node.unlink end }