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
9 10 11 12 13 |
# File 'lib/svg_optimizer/plugins/remove_empty_container.rb', line 9 def process while (nodes = xml.css(SELECTOR)).any? nodes.each(&method(:remove_node)) end end |