Module: Prawn::Markup::Processor::Lists
- Included in:
- Prawn::Markup::Processor
- Defined in:
- lib/prawn/markup/processor/lists.rb
Class Method Summary collapse
Instance Method Summary collapse
- #end_li ⇒ Object
- #end_list ⇒ Object (also: #end_ol, #end_ul)
- #start_img ⇒ Object
- #start_li ⇒ Object
- #start_list(ordered) ⇒ Object
- #start_ol ⇒ Object
- #start_ul ⇒ Object
Class Method Details
.prepended(base) ⇒ Object
4 5 6 |
# File 'lib/prawn/markup/processor/lists.rb', line 4 def self.prepended(base) base.known_elements.push('ol', 'ul', 'li') end |
Instance Method Details
#end_li ⇒ Object
40 41 42 43 44 |
# File 'lib/prawn/markup/processor/lists.rb', line 40 def end_li return unless inside_container? add_cell_text_node(current_list_item) end |
#end_list ⇒ Object Also known as: end_ol, end_ul
27 28 29 30 |
# File 'lib/prawn/markup/processor/lists.rb', line 27 def end_list list = list_stack.pop append_list(list) unless list.items.empty? end |
#start_img ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/prawn/markup/processor/lists.rb', line 46 def start_img if current_list add_cell_image(current_list_item) else super end end |
#start_li ⇒ Object
34 35 36 37 38 |
# File 'lib/prawn/markup/processor/lists.rb', line 34 def start_li return unless inside_container? current_list.items << Elements::Item.new end |
#start_list(ordered) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/prawn/markup/processor/lists.rb', line 16 def start_list(ordered) if current_list add_cell_text_node(current_list_item) elsif current_table add_cell_text_node(current_cell) else add_current_text end @list_stack.push(Elements::List.new(ordered)) end |
#start_ol ⇒ Object
8 9 10 |
# File 'lib/prawn/markup/processor/lists.rb', line 8 def start_ol start_list(true) end |
#start_ul ⇒ Object
12 13 14 |
# File 'lib/prawn/markup/processor/lists.rb', line 12 def start_ul start_list(false) end |