Module: Locomotive::Markdown

Defined in:
lib/locomotive/markdown.rb

Class Method Summary collapse

Class Method Details

.parserObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/locomotive/markdown.rb', line 8

def self.parser
  @@markdown ||= Redcarpet::Markdown.new Redcarpet::Render::HTML, {
    autolink:         true,
    fenced_code:      true,
    generate_toc:     true,
    gh_blockcode:     true,
    hard_wrap:        true,
    no_intraemphasis: true,
    strikethrough:    true,
    tables:           true,
    xhtml:            true
  }
end

.render(text) ⇒ Object



4
5
6
# File 'lib/locomotive/markdown.rb', line 4

def self.render(text)
  self.parser.render(text)
end