Class: Kramdown::Parser::KramdownYamlTablerize

Inherits:
Kramdown
  • Object
show all
Defined in:
lib/kramdown-tablerize/kramdown.rb

Constant Summary collapse

YAML_TABLE_PATTERN =
/^#{OPT_SPACE}---[ \t]*table[ \t]*---(.*?)---[ \t]*\/table[ \t]*---/m

Instance Method Summary collapse

Constructor Details

#initialize(source, options) ⇒ KramdownYamlTablerize

Returns a new instance of KramdownYamlTablerize.



41
42
43
44
# File 'lib/kramdown-tablerize/kramdown.rb', line 41

def initialize(source, options)
  super
  @block_parsers.unshift(:yaml_tablerize)
end

Instance Method Details

#parse_yaml_tablerizeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Convert Markdown -> :yaml_tablerize



48
49
50
51
# File 'lib/kramdown-tablerize/kramdown.rb', line 48

def parse_yaml_tablerize
  @src.pos += @src.matched_size
  @tree.children << Element.new(:yaml_tablerize, @src[1])
end