Allow mixing of code and colours with other attrs when outputting HTML.
This commit is contained in:
parent
170c5811a3
commit
5191b596f3
1 changed files with 10 additions and 4 deletions
|
@ -328,15 +328,21 @@ class Formatted(object):
|
|||
text = add_attribute(text, "code", True)
|
||||
attributes.pop("code")
|
||||
|
||||
elif attributes["fgcolor"] or attributes["bgcolor"]:
|
||||
if attributes["fgcolor"] or attributes["bgcolor"]:
|
||||
text = add_color(
|
||||
text,
|
||||
attributes["fgcolor"],
|
||||
attributes["bgcolor"]
|
||||
)
|
||||
else:
|
||||
for key, value in attributes.items():
|
||||
text = add_attribute(text, key, value)
|
||||
|
||||
if attributes["fgcolor"]:
|
||||
attributes.pop("fgcolor")
|
||||
|
||||
if attributes["bgcolor"]:
|
||||
attributes.pop("bgcolor")
|
||||
|
||||
for key, value in attributes.items():
|
||||
text = add_attribute(text, key, value)
|
||||
|
||||
return text
|
||||
|
||||
|
|
Loading…
Reference in a new issue