class Malt::Engine::BlueCloth

Public Instance Methods

create_engine(params={}) click to toggle source

Instantiate engine class and cache if applicable.

# 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={}) click to toggle source

Convert Markdown text to HTML text.

Calls superclass method Malt::Engine::Abstract#render
# 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

Private Instance Methods

require_engine() click to toggle source

Load bluecloth library if not already loaded.

# File lib/malt/engines/bluecloth.rb, line 41
def require_engine
  return if defined? ::BlueCloth
  require_library 'bluecloth'
end