Fix possible KeyError if code is not a color code
This commit is contained in:
parent
438a0785fb
commit
1f4a5bd42c
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue