Module: Nanoc3::Helpers::HTMLEscape
Nanoc3::Helpers::HTMLEscape contains functionality for HTML-escaping strings.
Public Visibility
Public Instance Method Summary
| #html_escape(string) #h |
Returns the HTML-escaped representation of the given string. |
|---|
Public Instance Method Details
html_escape
public
html_escape(string)
Also known as: h
Returns the HTML-escaped representation of the given string. Only &, <, > and " are escaped.
[View source]
11 12 13 14 15 16 |
# File 'lib/nanoc3/helpers/html_escape.rb', line 11 def html_escape(string) string.gsub('&', '&'). gsub('<', '<'). gsub('>', '>'). gsub('"', '"') end |