class ExceptionallyBeautiful::MarkdownRenderer

Attributes

text[R]

Public Class Methods

new(text) click to toggle source
# File lib/exceptionally_beautiful/markdown_renderer.rb, line 8
def initialize(text)
  @text = text
end

Public Instance Methods

render() click to toggle source
# File lib/exceptionally_beautiful/markdown_renderer.rb, line 12
def render
  markdown.render(text).html_safe
end

Private Instance Methods

extensions() click to toggle source
# File lib/exceptionally_beautiful/markdown_renderer.rb, line 22
def extensions
  {
    :autolink => true,
    :fenced_code_blocks => true,
    :no_intra_emphasis => true,
    :space_after_headers => true,
    :tables => true
  }
end
markdown() click to toggle source
# File lib/exceptionally_beautiful/markdown_renderer.rb, line 18
def markdown
  Redcarpet::Markdown.new(ExceptionallyBeautiful::HtmlRenderer, extensions)
end