Method: Formalist::RichText::Rendering::HTMLRenderer#block

Defined in:
lib/formalist/rich_text/rendering/html_renderer.rb

#block(type, key, children) ⇒ Object

Defines how to handle a block node



52
53
54
55
56
57
58
59
60
# File 'lib/formalist/rich_text/rendering/html_renderer.rb', line 52

def block(type, key, children)
  rendered_children = children.map { |child| yield(child) }

  if type == 'atomic'
    block_atomic(key, rendered_children)
  else
    render_block_element(type, rendered_children)
  end
end