Sha256: 69f96602ba218ea3faee4154607f10c55507026dc8be3306e086f236a23b3e32

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

require 'digest'
require 'reverse_markdown/version'
require 'reverse_markdown/mapper'
require 'reverse_markdown/errors'
require 'nokogiri'

module ReverseMarkdown

  def self.parse(input, opts={})
    root = case input
      when String                  then Nokogiri::HTML(input).root
      when Nokogiri::XML::Document then input.root
      when Nokogiri::XML::Node     then input
    end

    ReverseMarkdown::Mapper.new(opts).process_root(root)
  end

  # 2012/08/11 joe: possibly deprecate in favour of #parse
  class << self
    alias parse_string  parse
    alias parse_element parse
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reverse_markdown-0.4.7 lib/reverse_markdown.rb