class SvgOptimizer::Plugins::CleanupAttribute

Public Instance Methods

cleanup_attribute(attribute) click to toggle source
# File lib/svg_optimizer/plugins/cleanup_attribute.rb, line 14
def cleanup_attribute(attribute)
  attribute.value = attribute.value.strip.squeeze(" ")
end
process() click to toggle source
# File lib/svg_optimizer/plugins/cleanup_attribute.rb, line 6
def process
  xml.xpath("//*[@*]").each do |node|
    node.attributes.each do |_, attribute|
      cleanup_attribute attribute
    end
  end
end