Module: RbbCode::ListNode

Includes:
RecursiveConversion
Defined in:
lib/rbbcode/node_extensions.rb

Instance Method Summary collapse

Methods included from RecursiveConversion

#recursively_convert

Instance Method Details

#to_htmlObject



117
118
119
120
121
# File 'lib/rbbcode/node_extensions.rb', line 117

def to_html
  # Convert the :contents child node (defined in the .treetop file)

  # and wrap the result in <ul> tags.

  "\n<ul>" + recursively_convert(items, :to_html) + "</ul>\n"
end

#to_markdownObject



123
124
125
126
127
128
# File 'lib/rbbcode/node_extensions.rb', line 123

def to_markdown
  # Convert the :contents child node (defined in the .treetop file).

  # (Unlike with HTML, no outer markup needed.) Then append an extra

  # newline, for a total of two at the end.

  recursively_convert(items, :to_markdown) + "\n"
end