Class: Kramdown::Parser::GFM

Inherits:
Kramdown show all
Defined in:
lib/monkey_patches/kramdown/parser/gfm.rb

Instance Method Summary collapse

Methods inherited from Kramdown

#add_link, #parse_atx_header, #parse_autolink, #parse_blockquote, #parse_codeblock, #parse_codeblock_fenced, #parse_codespan, #parse_emphasis, #parse_escaped_chars, #parse_footnote_marker, #parse_horizontal_rule, #parse_link, #parse_list, #parse_paragraph, #parse_setext_header, #parse_span_html, #parse_typographic_syms

Instance Method Details

#parse_atx_header_gfm_quirkObject

Copied from kramdown/parser/kramdown/header.rb, removed the first line



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/monkey_patches/kramdown/parser/gfm.rb', line 6

def parse_atx_header_gfm_quirk
  start_line_number = @src.current_line_number
  @src.check(ATX_HEADER_MATCH)
  level, text, id = @src[1], @src[2].to_s.strip, @src[3]
  return false if text.empty?

  @src.pos += @src.matched_size
  el = new_block_el(:header, nil, nil, :level => level.length, :raw_text => text, :location => start_line_number, :original_text => @src[0].chomp)
  add_text(text, el)
  el.attr['id'] = id if id
  @tree.children << el
  true
end