From 5c0a202257ca2195900ef4dbbe3215f1fd730727 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 14 Apr 2008 22:32:38 +0200 Subject: utils: URI fragment is sometimes found in id attribute to A tag --- lib/rbot/core/utils/utils.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index ce5cdea4..22fcee37 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -623,13 +623,14 @@ module ::Irc title = txt.ircify_html_title debug opts if frag = opts[:uri_fragment] and not frag.empty? - fragreg = /]*name=["']?#{frag}["']?[^>]*>/im + fragreg = /]+\s+)?(?:name|id)=["']?#{frag}["']?[^>]*>/im debug fragreg debug txt if txt.match(fragreg) # grab the post-match txt = $' end + debug txt end c_opts = opts.dup c_opts[:strip] ||= title -- cgit v1.2.3