lib/converters/html_escape.rb in convert-0.1.2 vs lib/converters/html_escape.rb in convert-0.1.3
- old
+ new
@@ -1,11 +1,13 @@
-module Converters
+module Convert
+ module Converters
- # Escape html
- def escape_html(string, options = {})
- options = {:map => {'&' => '&', '>' => '>', '<' => '<', '"' => '"' }}.merge(options)
+ # Escape html
+ def escape_html(string, options = {})
+ options = {:map => {'&' => '&', '>' => '>', '<' => '<', '"' => '"' }}.merge(options)
- @regex = /[&"><]/
- string.gsub(@regex){|m| options[:map][m]}
- end
+ @regex = /[&"><]/
+ string.gsub(@regex){|m| options[:map][m]}
+ end
+ end
end