-
-class ::String
- def ircify_html
- txt = self
-
- # bold and strong -> bold
- txt.gsub!(/<\/?(?:b|strong)\s*>/, "#{Bold}")
-
- # italic, emphasis and underline -> underline
- txt.gsub!(/<\/?(?:i|em|u)\s*>/, "#{Underline}")
-
- ## This would be a nice addition, but the results are horrible
- ## Maybe make it configurable?
- # txt.gsub!(/<\/?a( [^>]*)?>/, "#{Reverse}")
-
- # Paragraph and br tags are converted to whitespace.
- txt.gsub!(/<\/?(p|br)\s*\/?\s*>/, ' ')
- txt.gsub!("\n", ' ')
-
- # All other tags are just removed
- txt.gsub!(/<[^>]+>/, '')
-
- # Remove double formatting options, since they only waste bytes
- txt.gsub!(/#{Bold}\s*#{Bold}/,"")
- txt.gsub!(/#{Underline}\s*#{Underline}/,"")
-
- # And finally whitespace is squeezed
- txt.gsub!(/\s+/, ' ')
-
- # Decode entities and strip whitespace
- return Utils.decode_html_entities(txt).strip!
- end
-end
+GOOGLE_CALC_RESULT = %r{<img src=/images/calc_img\.gif(?: width=40 height=30 alt="")?></td><td> </td><td nowrap>(?:<h2 class=r>)?<font size=\+1><b>(.+)</b>(?:</h2>)?</td>}
+GOOGLE_DEF_RESULT = %r{<p> (Web definitions for .*?)<br/>(.*?)<br/>(.*?)\s-\s+<a href}