Module: Account::MarkdownHelper

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

Instance Method Summary collapse

Instance Method Details

#markdown(string) ⇒ Object



2
3
4
5
6
7
8
# File 'app/helpers/account/markdown_helper.rb', line 2

def markdown(string)
  Commonmarker.to_html(string, options: {
    extensions: {header_ids: true},
    plugins: {syntax_highlighter: {theme: "InspiredGitHub"}},
    render: {width: 120, unsafe: true}
  }).gsub(/&lt;(\/)?script/, '<\\1script').html_safe
end