class Kramdown::Parser::Kramdown
def parse_footnote_marker
def parse_footnote_marker @src.pos += @src.matched_size fn_def = @doc.parse_infos[:footnotes][@src[1]] if fn_def valid = fn_def[:marker] && fn_def[:marker].options[:stack][0..-2].zip(fn_def[:marker].options[:stack][1..-1]).all? do |par, child| par.children.include?(child) end if !fn_def[:marker] || !valid fn_def[:marker] = Element.new(:footnote, nil, nil, :name => @src[1]) fn_def[:marker].options[:stack] = [@stack.map {|s| s.first}, @tree, fn_def[:marker]].flatten.compact @tree.children << fn_def[:marker] else warning("Footnote marker '#{@src[1]}' already appeared in document, ignoring newly found marker") add_text(@src.matched) end else warning("Footnote definition for '#{@src[1]}' not found") add_text(@src.matched) end end