Class: RedcarpetCompat
- Inherits:
-
Object
- Object
- RedcarpetCompat
- Defined in:
- lib/redcarpet/compat.rb
Overview
Deprecated: Please use the default API to parse Markdown documents ; this layer will be removed in Redcarpet 4.0.
Creates an instance of Redcarpet with the RedCloth API.
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, *exts) ⇒ RedcarpetCompat
constructor
A new instance of RedcarpetCompat.
- #to_html(*_dummy) ⇒ Object
Constructor Details
#initialize(text, *exts) ⇒ RedcarpetCompat
Returns a new instance of RedcarpetCompat.
10 11 12 13 14 15 |
# File 'lib/redcarpet/compat.rb', line 10 def initialize(text, *exts) exts_hash, render_hash = *(exts) @text = text renderer = Redcarpet::Render::HTML.new(render_hash) @markdown = Redcarpet::Markdown.new(renderer, exts_hash) end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
8 9 10 |
# File 'lib/redcarpet/compat.rb', line 8 def text @text end |
Instance Method Details
#to_html(*_dummy) ⇒ Object
17 18 19 |
# File 'lib/redcarpet/compat.rb', line 17 def to_html(*_dummy) @markdown.render(text) end |