Module: Opulent::Utils
- Defined in:
- lib/opulent/utils.rb
Constant Summary collapse
- ESCAPE_HTML =
Used by escape_html
{ '&' => '&', '"' => '"', '\'' => ''', '<' => '<', '>' => '>' }.freeze
- ESCAPE_HTML_PATTERN =
Pattern matching for html escape characters
Regexp.union(*ESCAPE_HTML.keys)
- INTERPOLATION_PATTERN =
Ruby interpolation pattern
/(\#\{[^}]+\})/
Instance Method Summary collapse
-
#escape(html) ⇒ String
Returns an escaped copy of ‘html`.
Instance Method Details
#escape(html) ⇒ String
Returns an escaped copy of ‘html`.
28 29 30 |
# File 'lib/opulent/utils.rb', line 28 def escape(html) EscapeUtils.escape_html html.to_s.chomp, false end |