Class: RedcarpetCompat

Inherits:
Object
  • Object
show all
Defined in:
lib/redcarpet/compat.rb

Overview

Creates an instance of Redcarpet with the RedCloth API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, *exts) ⇒ RedcarpetCompat

Returns a new instance of RedcarpetCompat.



5
6
7
8
9
10
# File 'lib/redcarpet/compat.rb', line 5

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

Instance Attribute Details

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/redcarpet/compat.rb', line 3

def text
  @text
end

Instance Method Details

#to_html(*_dummy) ⇒ Object



12
13
14
# File 'lib/redcarpet/compat.rb', line 12

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