Skip to content

write_html: handle an invalid percentage width like any other invalid width - #2091

Merged
andersonhc merged 5 commits into
py-pdf:masterfrom
RavSinghChandan:html-invalid-percentage-width
Oct 31, 2026
Merged

andersonhc merged 5 commits into
py-pdf:masterfrom
RavSinghChandan:html-invalid-percentage-width

Conversation

@RavSinghChandan

Copy link
Copy Markdown

<table width="x%">, <td width="x%">, <th width="%"> and <hr width="x%"> raised ValueError: could not convert string to float. An invalid percentage is now read as 0, the same as any other invalid width such as width="invalid"; the tests check the output is identical to that case.

  • A unit test is covering the code added / modified by this PR
  • A mention of the change is present in CHANGELOG.md
  • This PR is ready to be merged

@RavSinghChandan

Copy link
Copy Markdown
Author

Merged master to resolve the conflict and moved the changelog entry to the 2.9.1 section.

@andersonhc
andersonhc merged commit 5ba947c into py-pdf:master Oct 31, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants