Method: String#unescape_html
- Defined in:
- lib/sh_util.rb
#unescape_html ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/sh_util.rb', line 67 def unescape_html entities = { """ => "\"", "'" => "'", "&" => "&", "<" => "<", ">" => ">", " " => " " } return CGI.unescapeHTML(self.gsub(/&\w*;/) {|e| entities[e] || e}) end |