From 6167e109580de887ce69b1795231aee005e2c786 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 22 Aug 2007 22:45:35 +0000 Subject: url plugin: jump to fragment when grabbing first par of an url with fragment --- data/rbot/plugins/url.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data/rbot/plugins/url.rb') diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb index bc96341d..cdbe5cc8 100644 --- a/data/rbot/plugins/url.rb +++ b/data/rbot/plugins/url.rb @@ -70,6 +70,10 @@ class UrlPlugin < Plugin if @bot.config['url.first_par'] partial = resp.partial_body(@bot.config['http.info_bytes']) logopts[:title] = title = get_title_from_html(partial) + if url.fragment and not url.fragment.empty? + fragreg = /.*?]*name=["']?#{url.fragment}["']?.*?>/im + partial.sub!(fragreg,'') + end first_par = Utils.ircify_first_html_par(partial, :strip => title) unless first_par.empty? logopts[:extra] = first_par -- cgit v1.2.3