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
6 7 8 |
# File 'lib/prawn/markup/processor/lists.rb', line 6 def self.prepended(base) base.known_elements.push('ol', 'ul', 'li') end |
Instance Method Details
#end_li ⇒ Object
42 43 44 45 46 |
# File 'lib/prawn/markup/processor/lists.rb', line 42 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
29 30 31 32 |
# File 'lib/prawn/markup/processor/lists.rb', line 29 def end_list list = list_stack.pop append_list(list) unless list.items.empty? end |
#start_img ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/prawn/markup/processor/lists.rb', line 48 def start_img if current_list add_cell_image(current_list_item) else super end end |
#start_li ⇒ Object
36 37 38 39 40 |
# File 'lib/prawn/markup/processor/lists.rb', line 36 def start_li return unless inside_container? current_list.items << Elements::Item.new end |
#start_list(ordered) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/prawn/markup/processor/lists.rb', line 18 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
10 11 12 |
# File 'lib/prawn/markup/processor/lists.rb', line 10 def start_ol start_list(true) end |
#start_ul ⇒ Object
14 15 16 |
# File 'lib/prawn/markup/processor/lists.rb', line 14 def start_ul start_list(false) end |