Module: Nanoc3::Helpers::HTMLEscape
Overview
Contains functionality for HTML-escaping strings.
Instance Method Summary (collapse)
-
- (String) html_escape(string)
(also: #h)
Returns the HTML-escaped representation of the given string.
Instance Method Details
- (String) html_escape(string) Also known as: h
Returns the HTML-escaped representation of the given string. Only &,
<, > and " are escaped.
14 15 16 17 18 19 |
# File 'lib/nanoc3/helpers/html_escape.rb', line 14 def html_escape(string) string.gsub('&', '&'). gsub('<', '<'). gsub('>', '>'). gsub('"', '"') end |