class ReverseAdoc::HtmlConverter

Public Class Methods

convert(input, options = {}) click to toggle source
# File lib/reverse_adoc/html_converter.rb, line 39
def self.convert(input, options = {})
  root = if input.is_a?(String)
          then Nokogiri::HTML(input).root
         elsif input.is_a?(Nokogiri::XML::Document)
          then input.root
         elsif input.is_a?(Nokogiri::XML::Node)
          then input
         end

  root || (return "")

  ReverseAdoc.config.with(options) do
    result = ReverseAdoc::Converters.lookup(root.name).convert(root)
    ReverseAdoc.cleaner.tidy(result)
  end
end