Allow mixing of code and colours with other attrs when outputting HTML.

This commit is contained in:
Denis Kasak 2020-05-31 14:23:19 +02:00
parent 170c5811a3
commit 5191b596f3

View file

@ -328,13 +328,19 @@ 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:
if attributes["fgcolor"]:
attributes.pop("fgcolor")
if attributes["bgcolor"]:
attributes.pop("bgcolor")
for key, value in attributes.items():
text = add_attribute(text, key, value)