str + ": " + link
}
else
- warn "unknown :a_href option #{val} passed to ircify_html" if val
+ warning "unknown :a_href option #{val} passed to ircify_html" if val
end
# Paragraph and br tags are converted to whitespace
def riphtml
self.gsub(/<[^>]+>/, '').gsub(/&/,'&').gsub(/"/,'"').gsub(/</,'<').gsub(/>/,'>').gsub(/&ellip;/,'...').gsub(/'/, "'").gsub("\n",'')
end
+
+ # This method tries to find an HTML title in the string,
+ # and returns it if found
+ def get_html_title
+ if defined? ::Hpricot
+ Hpricot(self).at("title").inner_html
+ else
+ return unless Irc::Utils::TITLE_REGEX.match(self)
+ $1
+ end
+ end
+
+ # This method returns the IRC-formatted version of an
+ # HTML title found in the string
+ def ircify_html_title
+ self.get_html_title.ircify_html rescue nil
+ end
end