Sha256: 4570fc057592fd4561eadc695022911b3f9f32bbf377b8d1e992816cd45e1c4d
Contents?: true
Size: 1.03 KB
Versions: 5
Compression:
Stored size: 1.03 KB
Contents
module TechRadar module Rendering class Markdown def initialize require 'redcarpet' renderer = Redcarpet::Render::HTML.new( filter_html: true, no_styles: true, safe_links_only: true ) @markdown = Redcarpet::Markdown.new(renderer, no_intra_emphasis: true, tables: true, fenced_code_blocks: true, autolink: true, disable_indented_code_blocks: true, strikethrough: true, superscript: true) rescue LoadError => ex raise "Since you speecified markdown rendering, you must include the redcarpet gem in your app: #{ex.message}" end def render_text(text) @markdown.render(text).html_safe end end end end
Version data entries
5 entries across 5 versions & 1 rubygems