Class: Malt::Engine::RedCloth

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

Overview

Redcloth handles textile markup.

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



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

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

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

#render(params = {}) ⇒ Object

Convert textile text to html.

params:

:format => Symbol of the format to render [:html]


19
20
21
22
23
24
25
26
27
28
# File 'lib/malt/engines/redcloth.rb', line 19

def render(params={})
  into, text = parameters(params, :to, :text)

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