]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
extends: fix riphtml
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Jan 2011 12:31:53 +0000 (13:31 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Jan 2011 12:32:32 +0000 (13:32 +0100)
lib/rbot/core/utils/extends.rb

index d734db6120b7ae9518ca2d8d94a690868e13da13..208cb089a41b63fac593eaec6cbbc65093989ead 100644 (file)
@@ -341,7 +341,7 @@ class ::String
   # This method will strip all HTML crud from the receiver
   #
   def riphtml
-    self.gsub(/<[^>]+>/, '').gsub(/&amp;/,'&').gsub(/&quot;/,'"').gsub(/&lt;/,'<').gsub(/&gt;/,'>').gsub(/&ellip;/,'...').gsub(/&apos;/, "'").gsub("\n",'')
+    Utils.decode_html_entities(self.gsub("\n",' ').gsub(/<\s*br\s*\/?\s*>/, ' ').gsub(/<[^>]+>/, '')).gsub(/\s+/,' ')
   end
 
   # This method tries to find an HTML title in the string,