Module: Haml::Filters::Markdown

Includes:
Base
Defined in:
lib/gems/haml-2.0.4/lib/haml/filters.rb

Overview

Uses BlueCloth or RedCloth to provide only Markdown (not Textile) parsing

Instance Method Summary collapse

Methods included from Base

#compile, included, #internal_compile, #lazy_require, #render_with_options

Instance Method Details

#render(text) ⇒ Object



249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/gems/haml-2.0.4/lib/haml/filters.rb', line 249

def render(text)
  engine = case @required
           when 'rdiscount'
             RDiscount
           when 'peg_markdown'
             PEGMarkdown
           when 'maruku'
             Maruku
           when 'bluecloth'
             BlueCloth
           end
  engine.new(text).to_html
end