module Webby::Helpers::TagHelper - webby-0.9.4 Documentation

# module Webby::Helpers::TagHelper

Provides methods to generate HTML tags programmatically. By default, they output XHTML compliant tags.

### Constants

BOOLEAN_ATTRIBUTES

### Public Instance Methods

escape_once( html ) click to toggle source

Returns an escaped version of `html` without affecting existing escaped entities.

#### Examples¶ ↑

    escape_once("1 > 2 &amp; 3")
    # => "1 &lt; 2 &amp; 3"

    escape_once("&lt;&lt; Accept & Checkout")
    # => "&lt;&lt; Accept &amp; Checkout"

    # File lib/webby/helpers/tag_helper.rb, line 36
    def escape_once( html )
      html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
    end