From: Giuseppe Bilotta Date: Sun, 1 Apr 2007 16:58:12 +0000 (+0000) Subject: More first_par fixups X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=336457b2675e49b6b2708c61a5131a1cd97b6007;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git More first_par fixups --- diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb index 95569b71..5fa24dcb 100644 --- a/lib/rbot/core/utils/extends.rb +++ b/lib/rbot/core/utils/extends.rb @@ -55,6 +55,7 @@ class ::String if self.respond_to?(:http_headers) and headers = self.http_headers if headers['content-type'].first.match(/charset="?(\S+?)"?\s*;?/i) + debug "charset #{charset} set from header" charset = $1 end end @@ -66,10 +67,10 @@ class ::String when / Minimum number of spaces a paragraph should have # def Utils.ircify_first_html_par(xml_org, opts={}) - xml = xml_org.gsub(//, '').utfy_xml + xml = xml_org.gsub(//m, '').gsub(/]*)?>.*?<\/script>/im, "").gsub(/]*)?>.*?<\/style>/im, "").utfy_xml strip = opts[:strip] strip = Regexp.new(/^#{Regexp.escape(strip)}/) if strip.kind_of?(String)