Module: EscapeUtils::HtmlSafety
- Defined in:
- lib/escape_utils/html_safety.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.escape_once(s) {|s.to_s| ... } ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/escape_utils/html_safety.rb', line 4 def self.escape_once(s) s = s.to_s if s.html_safe? s.html_safe else yield(s).html_safe end end |
Instance Method Details
#_escape_html(s) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/escape_utils/html_safety.rb', line 13 def _escape_html(s) if s.html_safe? s.to_s.html_safe else EscapeUtils.escape_html(s.to_s).html_safe end end |