Merge pull request #20 from jaraco/master
Fixed two errors in HTML color handling code
This commit is contained in:
commit
db892646b7
1 changed files with 5 additions and 2 deletions
|
@ -198,6 +198,8 @@ def replace_color(code, text):
|
||||||
'36': '00aaaa',
|
'36': '00aaaa',
|
||||||
'37': 'F5F1DE',
|
'37': 'F5F1DE',
|
||||||
}
|
}
|
||||||
|
if code not in colors:
|
||||||
|
return text
|
||||||
return '<span style="color: #%(color)s">%(text)s</span>' % dict(
|
return '<span style="color: #%(color)s">%(text)s</span>' % dict(
|
||||||
color = colors[code],
|
color = colors[code],
|
||||||
text = text,
|
text = text,
|
||||||
|
@ -246,8 +248,9 @@ class Logbot(SingleServerIRCBot):
|
||||||
try: msg = msg.replace("%channel%", event.target())
|
try: msg = msg.replace("%channel%", event.target())
|
||||||
except: pass
|
except: pass
|
||||||
msg = msg.replace("%color%", self.color(nm_to_n(event.source())))
|
msg = msg.replace("%color%", self.color(nm_to_n(event.source())))
|
||||||
user_message = cgi.escape(event.arguments()[0])
|
try:
|
||||||
try: msg = msg.replace("%message%", html_color(user_message))
|
user_message = cgi.escape(event.arguments()[0])
|
||||||
|
msg = msg.replace("%message%", html_color(user_message))
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue