From 7232ed56774f9bfc89e4a31d486fa2f82bdec1ec Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 5 Apr 2007 14:20:00 +0000 Subject: HTML IRCification: try to handle super and subscripts --- lib/rbot/core/utils/extends.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/rbot/core/utils/extends.rb b/lib/rbot/core/utils/extends.rb index ff9d0f35..4b7e57f3 100644 --- a/lib/rbot/core/utils/extends.rb +++ b/lib/rbot/core/utils/extends.rb @@ -61,6 +61,12 @@ class ::String txt.gsub!("\n", ' ') txt.gsub!("\r", ' ') + # Superscripts and subscripts are turned into ^{...} and _{...} + # where the {} are omitted for single characters + txt.gsub!(/(.*?)<\/sup>/, '^{\1}') + txt.gsub!(/(.*?)<\/sub>/, '_{\1}') + txt.gsub!(/(^|_)\{(.)\}/, '\1\2') + # All other tags are just removed txt.gsub!(/<[^>]+>/, '') -- cgit v1.2.3