Module: ERB::Util

Included in:
Webby::Filters::Outline, Webby::Helpers::TagHelper, Webby::Renderer
Defined in:
lib/webby/helpers/tag_helper.rb

Constant Summary collapse

HTML_ESCAPE =
{ '&' => '&amp;', '"' => '&quot;', '>' => '&gt;', '<' => '&lt;' }

Instance Method Summary collapse

Instance Method Details

#html_escape(s) ⇒ Object



9
10
11
# File 'lib/webby/helpers/tag_helper.rb', line 9

def html_escape(s)
  s.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] }
end