Class: PseudoHiki::MarkDownFormat::EnumNodeFormatter

Inherits:
PseudoHiki::MarkDownFormat show all
Defined in:
lib/pseudohiki/markdownformat.rb

Constant Summary

Constants inherited from PseudoHiki::MarkDownFormat

Formatters, GFM_STRIPPED_CHARS, GFM_STRIPPED_CHARS_PAT

Instance Method Summary collapse

Methods inherited from PseudoHiki::MarkDownFormat

#collect_headings, convert_into_gfm_id_format, create, #create_self_element, default_options, #enclose_in, format, #format, #get_plain, #heading_to_gfm_id, #initialize, #list_mark, #prepare_id_conv_table, #remove_trailing_newlines_in_html_element, #visit, #visited_result

Constructor Details

This class inherits a constructor from PseudoHiki::MarkDownFormat

Instance Method Details

#push_visited_results(element, tree, memo) ⇒ Object



399
400
401
402
403
404
405
406
407
# File 'lib/pseudohiki/markdownformat.rb', line 399

def push_visited_results(element, tree, memo)
  memo_with_enum_count = { :original => memo, :enum_item_count => 0 }
  tree.each do |token|
    if token.kind_of? EnumWrapNode
      memo_with_enum_count[:enum_item_count] += 1
    end
    element.push visited_result(token, memo_with_enum_count)
  end
end

#tap_element_in_visit(element, tree, memo) ⇒ Object



409
410
411
# File 'lib/pseudohiki/markdownformat.rb', line 409

def tap_element_in_visit(element, tree, memo)
  element.push $/ if /\A\d/o.match? element.first.join
end