From 03999f1ef08036b7ea25e2239cf7b6bcdb4d76cc Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 8 Nov 2011 02:21:20 +0100 Subject: Make the rainbow plugin clean existing colors before adding the new colors. --- plugins/rainbow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/rainbow.py b/plugins/rainbow.py index 838c91f4..0f242027 100644 --- a/plugins/rainbow.py +++ b/plugins/rainbow.py @@ -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'])]) -- cgit v1.2.3