Sha256: 17d7a774334ea9510ec93cdf2ae219c9c96bb5ddd923ff957aea5f640199b846
Contents?: true
Size: 385 Bytes
Versions: 50
Compression:
Stored size: 385 Bytes
Contents
require 'template' class ERB module Util `var escapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": '''};` `var escape_regexp = /[&<>"']/g;` def html_escape(str) `return ("" + str).replace(escape_regexp, function (m) { return escapes[m] });` end alias h html_escape module_function :h module_function :html_escape end end
Version data entries
50 entries across 50 versions & 3 rubygems