Method: Formalist::RichText::Rendering::HTMLRenderer#entity

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

#entity(type, key, data, children) ⇒ Object



80
81
82
83
84
85
86
87
88
89
# File 'lib/formalist/rich_text/rendering/html_renderer.rb', line 80

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

  handler = :"entity_#{type.downcase}"
  if respond_to?(handler, _include_private=true)
    send(handler, data, rendered_children)
  else
    rendered_children
  end
end