Malt  Malt::Engine::RDiscount

[Validate]
Generated with RDazzle Newfish 1.4.0

RDiscount

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.

Public Instance Methods

intermediate(params) click to toggle source

Convert Markdown text to intermediate engine object.

    # File lib/malt/engines/rdiscount.rb, line 28
28:     def intermediate(params)
29:       text = params[:text]
30:       ::RDiscount.new(text, *flags)
31:     end
render(params) click to toggle source

Convert Markdown text to HTML text.

    # File lib/malt/engines/rdiscount.rb, line 18
18:     def render(params)
19:       case params[:to]
20:       when :html, nil
21:         intermediate(params).to_html
22:       else
23:         super(params)
24:       end
25:     end

Private Instance Methods

flags(params={}) click to toggle source
    # File lib/malt/engines/rdiscount.rb, line 42
42:     def flags(params={})
43:       [:smart, :filter_html].select{ |flag| params[flag] || settings[flag] }
44:     end
initialize_engine() click to toggle source

Load rdoc makup library if not already loaded.

    # File lib/malt/engines/rdiscount.rb, line 36
36:     def initialize_engine
37:       return if defined? ::RDiscount
38:       require_library 'rdiscount'
39:     end

Disabled; run with --debug to generate this.