Class: Malt::Engine::BlueCloth

Inherits:
Abstract show all
Defined in:
lib/malt/engines/bluecloth.rb

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, default, #initialize, #prepare_engine, register, type

Constructor Details

This class inherits a constructor from Malt::Engine::Abstract

Instance Method Details

#create_engine(params = {}) ⇒ Object

Instantiate engine class and cache if applicable.



30
31
32
33
34
35
36
# File 'lib/malt/engines/bluecloth.rb', line 30

def create_engine(params={})
  text = parameters(params, :text)

  cached(text) do
    ::BlueCloth.new(text)
  end
end

#render(params = {}) ⇒ Object

Convert Markdown text to HTML text.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/malt/engines/bluecloth.rb', line 11

def render(params={})
  into = params[:to]

  text = parameters(params, :text)

  case into
  when :html, nil
    prepare_engine(params).to_html
  else
    super(params)
  end
end