39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/reverse_asciidoctor/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 '')
ReverseAsciidoctor.config.with(options) do
result = ReverseAsciidoctor::Converters.lookup(root.name).convert(root)
ReverseAsciidoctor.cleaner.tidy(result)
end
end
|