]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Fix urban handling of links
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 29 Jan 2007 19:35:54 +0000 (19:35 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 29 Jan 2007 19:35:54 +0000 (19:35 +0000)
data/rbot/plugins/urban.rb

index d2ea86456eed50d16c4a0f3ce2693b87e793138a..c77a2e45601f40f5f2c3c226dc48c0b15c37ac24 100644 (file)
@@ -60,14 +60,14 @@ class UrbanPlugin < Plugin
 
   def get_def(text)
     # Start by removing the prev/home/next links
-    t = text.gsub(/(?:<a href.*?>prev<\/a> )?<a href.*?>home<\/a>(?: <a href.*?>next<\/a>)?/,'')
+    t = text.gsub(/(?:<a href[^>]*>prev<\/a> )?<a href[^>]*>home<\/a>(?: <a href[^>]*>next<\/a>)?/,'')
     # Close up paragraphs
     t.gsub!(/<\/?p>/, ' ')
     t.gsub!("\n", ' ')
     # Reverse headings
     t.gsub!(/<\/?b>/,"#{Reverse}")
     # Enbolden links
-    t.gsub!(/<\/?a(?: .*?)?>/,"#{Bold}")
+    t.gsub!(/<\/?a(?: [^>]*)?>/,"#{Bold}")
     # Reverse examples
     t.gsub!(/<\/?(?:i|em)>/,"#{Underline}")
     # Clear anything else