module ReverseMarkdown
Constants
- VERSION
Public Class Methods
cleaner()
click to toggle source
# File lib/reverse_markdown.rb, line 56 def self.cleaner @cleaner ||= Cleaner.new end
config() { |config| ... }
click to toggle source
# File lib/reverse_markdown.rb, line 50 def self.config @config ||= Config.new yield @config if block_given? @config end
convert(input, options = {})
click to toggle source
# File lib/reverse_markdown.rb, line 35 def self.convert(input, options = {}) root = case input when String then Nokogiri::HTML(input).root when Nokogiri::XML::Document then input.root when Nokogiri::XML::Node then input end root or return '' config.with(options) do result = ReverseMarkdown::Converters.lookup(root.name).convert(root) cleaner.tidy(result) end end