Module: RbbCode::ParagraphNode
- Includes:
- RecursiveConversion
- Defined in:
- lib/rbbcode/node_extensions.rb
Instance Method Summary collapse
Methods included from RecursiveConversion
Instance Method Details
#to_html ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/rbbcode/node_extensions.rb', line 51 def to_html # Convert all child nodes, concatenate the results, # and wrap the concatenated HTML in <p> tags. html = elements.collect do |node| recursively_convert(node, :to_html) end.join "\n<p>" + html + "</p>\n" end |
#to_markdown ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/rbbcode/node_extensions.rb', line 60 def to_markdown # Convert all child nodes, concatenate the results, # and append newline characters. markdown = elements.collect do |node| recursively_convert(node, :to_markdown) end.join markdown + "\n\n" end |