Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixed two errors in HTML color handling code #20

Merged
merged 2 commits into from Oct 10, 2012
Jump to file or symbol
Failed to load files and symbols.
+5 −2
Split
View
@@ -198,6 +198,8 @@ def replace_color(code, text):
'36': '00aaaa',
'37': 'F5F1DE',
}
+ if code not in colors:
+ return text
return '<span style="color: #%(color)s">%(text)s</span>' % dict(
color = colors[code],
text = text,
@@ -246,8 +248,9 @@ def format_event(self, name, event, params):
try: msg = msg.replace("%channel%", event.target())
except: pass
msg = msg.replace("%color%", self.color(nm_to_n(event.source())))
- user_message = cgi.escape(event.arguments()[0])
- try: msg = msg.replace("%message%", html_color(user_message))
+ try:
+ user_message = cgi.escape(event.arguments()[0])
+ msg = msg.replace("%message%", html_color(user_message))
except: pass
return msg