Module: HParser::ListContainerHtml

Included in:
Block::OrderList, Block::UnorderList
Defined in:
lib/hparser/html.rb

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/hparser/html.rb', line 50

def to_html
  f = false
  content = html_content.map{|x|
    if x.class == Block::ListItem
      s = (f ? "</li>" : "") + %(<li>#{x.to_html})
      f = true
      s
    else
      x.to_html
    end
  }.join
  content += "</li>" if f
  %(<#{html_tag}>#{content}</#{html_tag}>)
end