Fix possible KeyError if code is not a color code

This commit is contained in:
Jason R. Coombs 2012-10-09 17:41:17 -04:00
parent 438a0785fb
commit 1f4a5bd42c

View file

@ -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,