Sha256: 9483244055cc46bd8f5951892bf05d0f795e405d1880d783b35b7d62c0ce96b8

Contents?: true

Size: 374 Bytes

Versions: 9

Compression:

Stored size: 374 Bytes

Contents

module InlineSvg::TransformPipeline::Transformations
  class Description < Transformation
    def transform(doc)
      doc = Nokogiri::XML::Document.parse(doc.to_html)
      node = Nokogiri::XML::Node.new('desc', doc)
      node.content = value
      doc.search('svg desc').each { |node| node.remove }
      doc.at_css('svg').prepend_child(node)
      doc
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inline_svg-1.2.1 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-1.2.0 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-1.1.0 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-1.0.1 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-1.0.0 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-0.12.1 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-0.12.0 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-0.11.1 lib/inline_svg/transform_pipeline/transformations/description.rb
inline_svg-0.11.0 lib/inline_svg/transform_pipeline/transformations/description.rb