Class: ActiveCopy::Markdown

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

Instance Method Summary collapse

Constructor Details

#initializeMarkdown

Create a new session with the compiler.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/active_copy/markdown.rb', line 11

def initialize
  @renderer = ActiveCopy::Renderer.new
  @options = {
    autolink: true,
    no_intra_emphasis: true,
    fenced_code_blocks: true,
    lax_html_blocks: true,
    strikethrough: true,
    superscript: true
  }
end

Instance Method Details

#render(markdown_source) ⇒ Object

Return an HTML String containing the rendered output of the Markdown source.



25
26
27
# File 'lib/active_copy/markdown.rb', line 25

def render markdown_source
  markdown.render "#{markdown_source}"
end