Class: Malt::Engines::RDiscount
- Defined in:
- lib/malt/engines/rdiscount.rb
Overview
Discount Markdown implementation.
http://github.com/rtomayko/rdiscount
The :smart
and :filter_html
options can be set true to enable those flags on the underlying RDiscount object.
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#intermediate(params) ⇒ Object
Convert Markdown text to intermediate engine object.
-
#render(params) ⇒ Object
Convert Markdown text to HTML text.
Methods inherited from Abstract
#cache?, #compile, default, #initialize, register
Constructor Details
This class inherits a constructor from Malt::Engines::Abstract
Instance Method Details
#intermediate(params) ⇒ Object
Convert Markdown text to intermediate engine object.
28 29 30 31 |
# File 'lib/malt/engines/rdiscount.rb', line 28 def intermediate(params) text = params[:text] ::RDiscount.new(text, *flags) end |
#render(params) ⇒ Object
Convert Markdown text to HTML text.
18 19 20 21 22 23 24 25 |
# File 'lib/malt/engines/rdiscount.rb', line 18 def render(params) case params[:format] when :html, nil intermediate(params).to_html else super(params) end end |