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)
|
text = add_attribute(text, "code", True)
|
||||||
attributes.pop("code")
|
attributes.pop("code")
|
||||||
|
|
||||||
elif attributes["fgcolor"] or attributes["bgcolor"]:
|
if attributes["fgcolor"] or attributes["bgcolor"]:
|
||||||
text = add_color(
|
text = add_color(
|
||||||
text,
|
text,
|
||||||
attributes["fgcolor"],
|
attributes["fgcolor"],
|
||||||
attributes["bgcolor"]
|
attributes["bgcolor"]
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
for key, value in attributes.items():
|
if attributes["fgcolor"]:
|
||||||
text = add_attribute(text, key, value)
|
attributes.pop("fgcolor")
|
||||||
|
|
||||||
|
if attributes["bgcolor"]:
|
||||||
|
attributes.pop("bgcolor")
|
||||||
|
|
||||||
|
for key, value in attributes.items():
|
||||||
|
text = add_attribute(text, key, value)
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue