Module: ERB::Util
- Included in:
- Webby::Helpers::TagHelper, Webby::Renderer
- Defined in:
- lib/webby/helpers/tag_helper.rb
Constant Summary collapse
- HTML_ESCAPE =
{ '&' => '&', '"' => '"', '>' => '>', '<' => '<' }
Instance Method Summary collapse
Instance Method Details
#html_escape(s) ⇒ Object
8 9 10 |
# File 'lib/webby/helpers/tag_helper.rb', line 8 def html_escape(s) s.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] } end |