Make the rainbow plugin clean existing colors before adding the new colors.

This commit is contained in:
Florent Le Coz 2011-11-08 02:21:20 +01:00
parent b3072bd261
commit 03999f1ef0

View file

@ -1,4 +1,5 @@
from plugin import BasePlugin
import xhtml
import random
possible_colors = list(range(256))
@ -16,4 +17,4 @@ class Plugin(BasePlugin):
self.add_poezio_event_handler('conversation_say', self.rainbowize)
def rainbowize(self, msg):
msg['body'] = ''.join(['%s%s' % (rand_color(),char,) for char in msg['body']])
msg['body'] = ''.join(['%s%s' % (rand_color(),char,) for char in xhtml.clean_text(msg['body'])])