]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Fix IRCification of HTML strings when only whitespace is present between IRC bold...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 6 Feb 2007 16:50:21 +0000 (16:50 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 6 Feb 2007 16:50:21 +0000 (16:50 +0000)
lib/rbot/core/utils/extends.rb

index b1da19c5346bef117d2869f0a491c933f0c79388..63aab7f0dc059957a34b6c75dd39bbca6be397aa 100644 (file)
@@ -49,8 +49,8 @@ class ::String
     txt.gsub!(/<[^>]+>/, '')
 
     # Remove double formatting options, since they only waste bytes
-    txt.gsub!(/#{Bold}\s*#{Bold}/,"")
-    txt.gsub!(/#{Underline}\s*#{Underline}/,"")
+    txt.gsub!(/#{Bold}(\s*)#{Bold}/, '\1')
+    txt.gsub!(/#{Underline}(\s*)#{Underline}/, '\1')
 
     # And finally whitespace is squeezed
     txt.gsub!(/\s+/, ' ')