Module: RbbCode::RecursiveConversion
- Included in:
- BlockquoteNode, ListItemNode, ListNode, ParagraphNode, TagNode
- Defined in:
- lib/rbbcode/node_extensions.rb
Instance Method Summary collapse
Instance Method Details
#recursively_convert(node, depth = 0) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rbbcode/node_extensions.rb', line 10 def recursively_convert(node, depth = 0) if node.terminal? if node.respond_to?(:to_html) node.to_html else node.text_value.match(/^[\r\n\t]+$/) ? '' : node.text_value end else if node.respond_to?(:to_html) node.to_html else node.elements.collect do |sub_node| recursively_convert(sub_node, depth + 1) end.join end end end |