diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 08:12:59 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 08:12:59 +0000 |
commit | 1d7ab28b2162db5c3a7b332a2f268d496b7c3c60 (patch) | |
tree | 7c176a0086d70f1302580ee7460ca4a3265adad4 /data/rbot | |
parent | c7146d39eede9d1f439bda48117b4dc194ce120e (diff) |
Refine urban plugin output with bold, reverse and underline. If it's too much, we'll spartanize.
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/urban.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb index 36c39077..95210b25 100644 --- a/data/rbot/plugins/urban.rb +++ b/data/rbot/plugins/urban.rb @@ -59,7 +59,21 @@ class UrbanPlugin < Plugin end def get_def(text) - Utils.decode_html_entities text.gsub(/(?:<a href.*?>prev<\/a> )?<a href.*?>home<\/a>(?: <a href.*?>next<\/a>)?/,'').gsub(/<\/?p>/, ' ').gsub(/<.*?>/, '').gsub("\n", ' ').strip + # Start by removing the prev/home/next links + t = text.gsub(/(?:<a href.*?>prev<\/a> )?<a href.*?>home<\/a>(?: <a href.*?>next<\/a>)?/,'') + # Close up paragraphs + t.gsub!(/<\/?p>/, ' ') + t.gsub!("\n", ' ') + # Reverse headings + t.gsub!(/<\/?b>/,"#{Reverse}") + # Enbolden links + t.gsub!(/<\/?a(?: .*?)?>/,"#{Bold}") + # Reverse examples + t.gsub!(/<\/?(?:i|em)>/,"#{Underline}") + # Clear anything else + t.gsub!(/<.*?>/, '') + + Utils.decode_html_entities t.strip end def uotd(m, params) |