Module: HParser::Block

Includes:
Util
Included in:
Parser
Defined in:
lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/latex.rb,
lib/hparser/hatena.rb,
lib/hparser/block/p.rb,
lib/hparser/block/dl.rb,
lib/hparser/block/pre.rb,
lib/hparser/block/raw.rb,
lib/hparser/block/head.rb,
lib/hparser/block/list.rb,
lib/hparser/block/pair.rb,
lib/hparser/block/quote.rb,
lib/hparser/block/table.rb,
lib/hparser/block/see_more.rb,
lib/hparser/block/super_pre.rb,
lib/hparser/block/collectable.rb,
lib/hparser/block/footnote_list.rb

Defined Under Namespace

Modules: Collectable, Indent Classes: Dl, Empty, FoonoteList, FootnoteList, Head, ListItem, OrderList, P, Pair, Pre, Quote, RAW, SeeMore, SuperPre, Table, TableCell, TableHeader, UnorderList

Constant Summary collapse

Ul =
UnorderList
Ol =
OrderList
Li =
ListItem
Th =
TableHeader
Td =
TableCell

Class Method Summary collapse

Class Method Details

.make_list_parser(level, mark, &proc) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/hparser/block/list.rb', line 12

def self.make_list_parser(level,mark,&proc)
  ProcParser.new{|scanner,context,inlines|
    if level == 3 then
      parser = Many1.new(Li.make_parser(level,mark))
    else
      parser = Many1.new(Or.new(UnorderList.make_parser(level+1),
                                OrderList.make_parser(level+1),
                                Li.make_parser(level,mark)))
    end
    list = parser.parse(scanner,context,inlines)
    
    if list then
      proc.call list
    end
  }
end