class MarkdownExplorer::Renderer

Attributes

markup[R]

Public Class Methods

new(text) click to toggle source
# File lib/markdown_explorer/renderer.rb, line 6
def initialize(text)
  @text = text
  render
end

Private Instance Methods

extensions() click to toggle source
# File lib/markdown_explorer/renderer.rb, line 25
def extensions
  {
    no_intra_emphasis: true,
    tables: true,
    fenced_code_blocks: true,
    autolink: true,
    strikethrough: true,
    superscript: true,
    underline: true
  }
end
html_renderer() click to toggle source
# File lib/markdown_explorer/renderer.rb, line 21
def html_renderer
  Redcarpet::Render::HTML
end
markdown() click to toggle source
# File lib/markdown_explorer/renderer.rb, line 17
def markdown
  @_markdown ||= Redcarpet::Markdown.new(html_renderer, extensions)
end
render() click to toggle source
# File lib/markdown_explorer/renderer.rb, line 13
def render
  @markup = markdown.render(@text)
end