Repository navigation
write_html: read a CSS font-size with its unit, like browsers - #2034
Merged
Merged
Conversation
andersonhc
approved these changes
Oct 20, 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.
<font style="font-size: 14pt">orstyle="font-size: 12px"was silently ignored bywrite_html(): the value went throughfloat(), which only accepts a bare number, so the text kept the previous size. Browsers apply the unit.The value is now read with
resolve_length(), the parser already used for table and image dimensions, so14ptgives 14 pt,12px9 pt and0.25in18 pt. A number without a unit is still read as points, and values it can't convert (1.5em,larger) are still ignored, as before. Added tests comparing against the equivalentsizeattribute.