Class: SvgOptimizer::Plugins::RemoveEmptyContainer
- Defined in:
- lib/svg_optimizer/plugins/remove_empty_container.rb
Constant Summary collapse
- ELEMENTS =
%w[ a defs g marker mask missing-glyph pattern switch symbol ].freeze
- SELECTOR =
ELEMENTS.map {|element| %[#{element}:empty] }.join(", ")
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from SvgOptimizer::Plugins::Base
Instance Method Details
#process ⇒ Object
19 20 21 22 23 |
# File 'lib/svg_optimizer/plugins/remove_empty_container.rb', line 19 def process while (nodes = xml.css(SELECTOR)).any? nodes.each(&method(:remove_node)) end end |