Module: Haml::Filters::Markdown

Includes:
Base
Defined in:
/var/www/haml-pages/.haml/lib/haml/filters.rb

Overview

Parses the filtered text with Markdown. Only works if RDiscount, RPeg-Markdown, Maruku, or BlueCloth are installed.

Instance Method Summary

Methods included from Base

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

Instance Method Details

- render(text)

See Also:



349
350
351
352
353
354
355
356
357
358
359
360
361
# File '/var/www/haml-pages/.haml/lib/haml/filters.rb', line 349

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