Sha256: e7ba40f0c611863aea2b35fd8a98098c87bd3e0cfdf989bc41e0cc1ec919ded7

Contents?: true

Size: 512 Bytes

Versions: 3

Compression:

Stored size: 512 Bytes

Contents

module PagesCms
  module MarkdownRenderer
    def markdown(text)
      render_options = {
        filter_html: true,
        hard_wrap: true,
        link_attributes: { target: '_blank' },
        prettify: true
      }
      renderer = Redcarpet::Render::HTML.new(render_options)
      extensions = {
        autolink: true,
        fenced_code_blocks: true,
        lax_spacing: true,
        superscript: true
      }
      Redcarpet::Markdown.new(renderer,extensions).render(text).html_safe
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pages_cms-2.2.3 app/models/pages_cms/markdown_renderer.rb
pages_cms-2.2.2 app/models/pages_cms/markdown_renderer.rb
pages_cms-2.2.1 app/models/pages_cms/markdown_renderer.rb