Sha256: f004c28019debfe3a187a69aedd3d732a03e5769357b5b200372510579165f43
Contents?: true
Size: 538 Bytes
Versions: 17
Compression:
Stored size: 538 Bytes
Contents
# encoding: utf-8 module Nanoc3::Helpers # Contains functionality for HTML-escaping strings. module HTMLEscape # 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('&', '&'). gsub('<', '<'). gsub('>', '>'). gsub('"', '"') end alias h html_escape end end
Version data entries
17 entries across 17 versions & 1 rubygems