Class: Markdpwn::RedCarpetRenderer

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/markdpwn/red_carpet_renderer.rb

Overview

RedCarpet HTML renderer, augmented to parse code blocks.

Constant Summary collapse

DEFAULT_OPTIONS =
{
  filter_html: true,
  no_styles: true,
  safe_links_only: true
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RedCarpetRenderer

Returns a new instance of RedCarpetRenderer.


12
13
14
# File 'lib/markdpwn/red_carpet_renderer.rb', line 12

def initialize(options = {})
  super DEFAULT_OPTIONS.merge options
end

Instance Method Details

#block_code(code, language) ⇒ Object


16
17
18
# File 'lib/markdpwn/red_carpet_renderer.rb', line 16

def block_code(code, language)
  Markdpwn::Code.render code, language: language
end