Module: Hanami::Helpers::HtmlHelper
- Included in:
- FormHelper, LinkToHelper
- Defined in:
- lib/hanami/helpers/html_helper.rb,
lib/hanami/helpers/html_helper/html_node.rb,
lib/hanami/helpers/html_helper/text_node.rb,
lib/hanami/helpers/html_helper/html_builder.rb,
lib/hanami/helpers/html_helper/html_fragment.rb,
lib/hanami/helpers/html_helper/empty_html_node.rb
Overview
HTML builder
By including Hanami::Helpers::HtmlHelper
it will inject one private method: html
. This is a HTML5 markup builder.
Features:
* Support for complex markup without the need of concatenation
* Auto closing HTML5 tags
* Custom tags
* Content tag auto escape (XSS protection)
* Support for view local variables
Usage:
* It knows how to close tags according to HTML5 spec (1)
* It accepts content as first argument (2)
* It accepts another builder as first argument (3)
* It accepts content as block which returns a string (4)
* It accepts content as a block with nested markup builders (5)
* It builds attributes from given hash (6)
* It combines attributes and block (7)
Defined Under Namespace
Classes: EmptyHtmlNode, HtmlBuilder, HtmlFragment, HtmlNode, TextNode