class RedcarpetCompat

Creates an instance of Redcarpet with the RedCloth API.

def initialize(text, *exts)

def initialize(text, *exts)
  exts_hash, render_hash = *parse_extensions_and_renderer_options(exts)
  @text = text
  renderer = Redcarpet::Render::HTML.new(render_hash)
  @markdown = Redcarpet::Markdown.new(renderer, exts_hash)
end

def list_to_truthy_hash(list)

Turns a list of symbols into a hash of symbol => true.
def list_to_truthy_hash(list)
  list.inject({}) {|h, k| h[k] = true; h }
end

def parse_extensions_and_renderer_options(exts)

given the extension list
Returns two hashes, the extensions and renderer options
def parse_extensions_and_renderer_options(exts)
  exts = rename_extensions(exts)
  exts.partition {|ext| !RENDERER_OPTIONS.include?(ext) }.
    map {|list| list_to_truthy_hash(list) }
end

def rename_extensions(exts)

def rename_extensions(exts)
  exts.map do |old_name|
    if new_name = EXTENSION_MAP[old_name]
      new_name
    else
      old_name
    end
  end.compact
end

def to_html(*_dummy)

def to_html(*_dummy)
  @markdown.render(text)
end