Methods

Class/Module Index [+]

Quicksearch

Nanoc3::Helpers::HTMLEscape

Contains functionality for HTML-escaping strings.

Public Instance Methods

h(string) click to toggle source
Alias for: html_escape
html_escape(string) click to toggle source

Returns the HTML-escaped representation of the given string. Only `&`, `<`, `>` and `“` are escaped.

@param [String] string The string to escape

@return [String] The escaped string

# File lib/nanoc3/helpers/html_escape.rb, line 13
def html_escape(string)
  string.gsub('&', '&amp;').
         gsub('<', '&lt;').
         gsub('>', '&gt;').
         gsub('"', '&quot;')
end
Also aliased as: h

[Validate]

Generated with the Darkfish Rdoc Generator 2.