Method: Lines::ApplicationHelper#markdown
- Defined in:
- app/helpers/lines/application_helper.rb
#markdown(text) ⇒ Object
Returns formatted and highlighted code fragments
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/helpers/lines/application_helper.rb', line 19 def markdown(text) renderer = HTMLwithPygments.new(hard_wrap: true, filter_html: false, with_toc_data: false) = { autolink: true, no_intra_emphasis: true, fenced_code_blocks: true, lax_html_blocks: true, tables: true, strikethrough: true, superscript: true, xhtml: true } Redcarpet::Markdown.new(renderer, ).render(text).html_safe end |