Sha256: 3982762cea8e9b0c417b82b74f3f3299352327c8b8220331fdc277ba0f8af388
Contents?: true
Size: 723 Bytes
Versions: 12
Compression:
Stored size: 723 Bytes
Contents
module Ucpengine module MarkdownHelper class HTMLwithPygments < ::Redcarpet::Render::HTML include ::Redcarpet::Render::SmartyPants def block_code(code, language) Pygments.highlight(code, lexer: language) end end 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 end end
Version data entries
12 entries across 12 versions & 1 rubygems