Sha256: 2cebeae5b9c9740c9fcc473b22c300fdf33ca5595c43d8e5a286364a00d27235
Contents?: true
Size: 372 Bytes
Versions: 92
Compression:
Stored size: 372 Bytes
Contents
class CGI TABLE_FOR_ESCAPE_HTML__ = { '&' => '&', '"' => '"', '<' => '<', '>' => '>', } # Escape special characters in HTML, namely &\"<> # CGI::escapeHTML('Usage: foo "bar" <baz>') # # => "Usage: foo "bar" <baz>" def CGI::escapeHTML(string) string.gsub(/[&\"<>]/, TABLE_FOR_ESCAPE_HTML__) end end
Version data entries
92 entries across 92 versions & 2 rubygems