Module: Ucpengine::MarkdownHelper

Defined in:
app/helpers/ucpengine/markdown_helper.rb

Defined Under Namespace

Classes: HTMLwithPygments

Instance Method Summary collapse

Instance Method Details

#markdown(text) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/ucpengine/markdown_helper.rb', line 11

def markdown(text)
  renderer = HTMLwithPygments.new(hard_wrap: true, filter_html: false)
  options = {
    filter_html: false,
    autolink: true,
    no_intra_emphasis: true,
    fenced_code_blocks: true,
    lax_html_blocks: true,
    strikethrough: true,
    superscript: true,
    tables: true,
    footnotes: true
  }
  ::Redcarpet::Markdown.new(renderer, options).render(text.to_s).html_safe
end