module InlineSvg::TransformPipeline
  module Transformations
    class NoComment < Transformation
      def transform(doc)
        doc = Nokogiri::XML::Document.parse(doc.to_html)
        doc.xpath("//comment()").each do |comment|
          comment.remove
        end
        doc
      end
    end
  end
end

module InlineSvg::TransformPipeline
  module Transformations
    class NoComment < Transformation
      def transform(doc)
        with_svg(doc) do |svg|
          svg.xpath("//comment()").each do |comment|
            comment.remove
          end
        end
      end
    end
  end
end

Handle documents without SVG root elements
Handle documents without SVG root elements
