Class: Kramdown::Parser::KramdownExt

Inherits:
Kramdown
  • Object
show all
Defined in:
lib/tty/markdown/kramdown_ext.rb

Constant Summary collapse

FENCED_CODEBLOCK_START =
/^[ ]{0,3}[~`]{3,}/.freeze
FENCED_CODEBLOCK_MATCH =
/^[ ]{0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^[ ]{0,3}\1\2*\s*?\n/m.freeze

Instance Method Summary collapse

Constructor Details

#initialize(source, options) ⇒ KramdownExt

Returns a new instance of KramdownExt.


8
9
10
11
12
13
14
# File 'lib/tty/markdown/kramdown_ext.rb', line 8

def initialize(source, options)
  super

  { codeblock_fenced: :codeblock_fenced_ext }.each do |current, replacement|
    @block_parsers[@block_parsers.index(current)] = replacement
  end
end