Module: TipTap::MarkdownRenderable
- Included in:
- Node
- Defined in:
- lib/tip_tap/markdown_renderable.rb
Instance Method Summary collapse
Instance Method Details
#to_markdown(context = Markdown::Context.root) ⇒ Object
39 40 41 42 |
# File 'lib/tip_tap/markdown_renderable.rb', line 39 def to_markdown(context = Markdown::Context.root) rendered_blocks = content.map { |node| node.to_markdown(context) }.reject(&:blank?) rendered_blocks.join("\n\n").gsub(/\n{3,}/, "\n\n").rstrip end |