Sha256: 7ae608554947f2b7132aa86fccdb49020d4c62e19570aba75f1fd07635db0e5b

Contents?: true

Size: 224 Bytes

Versions: 32

Compression:

Stored size: 224 Bytes

Contents

AutoHtml.add_filter(:html_escape).with(
  :map => { 
    '&' => '&',  
    '>' => '>',
    '<' => '&lt;',
    '"' => '&quot;' }) do |text, options|

  text.to_s.gsub(/[&"><]/) { |special| options[:map][special] }
end

Version data entries

32 entries across 32 versions & 5 rubygems

Version Path
auto_html-1.3.7 lib/auto_html/filters/html_escape.rb
marcosinger-auto_html-1.3.5 lib/auto_html/filters/html_escape.rb
marcosinger-auto_html-1.3.4 lib/auto_html/filters/html_escape.rb
auto_html-1.3.6 lib/auto_html/filters/html_escape.rb
auto_html-1.3.5 lib/auto_html/filters/html_escape.rb
auto_html-1.3.4 lib/auto_html/filters/html_escape.rb
auto_html-1.3.3 lib/auto_html/filters/html_escape.rb
auto_html-1.3.2 lib/auto_html/filters/html_escape.rb
auto_html-1.3.1 lib/auto_html/filters/html_escape.rb
auto_html-1.3.0 lib/auto_html/filters/html_escape.rb
auto_html-1.2.1 lib/auto_html/filters/html_escape.rb
auto_html-1.2.0 lib/auto_html/filters/html_escape.rb