Repository navigation
write_html: ignore a transparent color or bgcolor, like browsers - #2010
Merged
andersonhc merged 3 commits intoOct 12, 2026
Merged
Conversation
andersonhc
reviewed
Oct 12, 2026
andersonhc
left a comment
Collaborator
There was a problem hiding this comment.
Please make sure transparent is not being handled as use default color.
<font color="red">a<font color="transparent">b</font>c</font> - should print ab in red
<table><tr bgcolor="red"><td bgcolor="transparent">a</td></tr></table> should have red background
Author
|
You're right, thanks! transparent is now treated as if the attribute wasn't set, so the inherited color is kept: in abc all of it stays red, and keeps the red background, empty cells included. I added both as tests. |
andersonhc
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bgcolor="transparent"or<font color="transparent">raisedValueError: transparent does not start with #. In HTML color attributes, "transparent" is an error that browsers ignore, so the element keeps its normal color and no background.color_as_decimal()now returnsNonefor it, the same as an empty color. Added tests forcolorandbgcoloron<font>,<tr>and<td>.e.g. Fixes #0
Checklist:
A unit test is covering the code added / modified by this PR
In case of a new feature, docstrings have been added, with also some documentation in the
docs/folderA mention of the change is present in
CHANGELOG.mdThis PR is ready to be merged
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.