lib/nanoc3/helpers/html_escape.rb in nanoc3-3.0.9 vs lib/nanoc3/helpers/html_escape.rb in nanoc3-3.1.0a1

- old
+ new

@@ -1,14 +1,17 @@ # encoding: utf-8 module Nanoc3::Helpers - # Nanoc3::Helpers::HTMLEscape contains functionality for HTML-escaping - # strings. + # Contains functionality for HTML-escaping strings. module HTMLEscape - # Returns the HTML-escaped representation of the given string. Only &, <, - # > and " are escaped. + # 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 def html_escape(string) string.gsub('&', '&amp;'). gsub('<', '&lt;'). gsub('>', '&gt;'). gsub('"', '&quot;')