Module: Haml::Filters::Markdown

Includes:
Base
Defined in:
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



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

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