Module: DbSample::Prepare

Defined in:
lib/db_sample/prepare.rb

Class Method Summary collapse

Class Method Details

.markdown_to_html(text, interpitator = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/db_sample/prepare.rb', line 4

def self.markdown_to_html(text, interpitator=nil)
  interpitator = 'kramdown' if interpitator.nil?
  case interpitator
    when "maruku"
      Maruku.new(text).to_html
    when "rdiscount"
      RDiscount.new(text, :smart, :filter_html).to_html
    when "kramdown"
      Kramdown::Document.new(text, :auto_ids => false).to_html
    when "html"
      text
  end
end