def with_svg(doc)
      doc = Nokogiri::XML::Document.parse(
        doc.to_html(encoding: "UTF-8"), nil, "UTF-8"
      )
      svg = doc.at_css "svg"
      yield svg if svg && block_given?
      doc
    end
def with_svg(doc)
      doc = Nokogiri::XML::Document.parse(
        doc.to_html(encoding: "UTF-8"), nil, "UTF-8"
      )
      svg = doc.at_css "svg"
      yield svg if svg && block_given?
      doc
    end
Parses a document and yields the contained SVG nodeset to the given block
 if it exists.

 Returns a Nokogiri::XML::Document.