Class: Reaction::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/reaction/markdown.rb

Class Method Summary collapse

Class Method Details

.markdownObject



11
12
13
# File 'lib/reaction/markdown.rb', line 11

def self.markdown
  @markdown ||= Redcarpet::Markdown.new(renderer, autolink: true, tables: true)
end

.render(md_str) ⇒ Object



3
4
5
# File 'lib/reaction/markdown.rb', line 3

def self.render(md_str)
  markdown.render(md_str)
end

.rendererObject



7
8
9
# File 'lib/reaction/markdown.rb', line 7

def self.renderer
  @renderer ||= Redcarpet::Render::HTML.new
end