Skip to content

write_html: support <li value> in ordered lists, like browsers - #2032

Merged
andersonhc merged 2 commits into
py-pdf:masterfrom
RavSinghChandan:html-li-value
Oct 20, 2026
Merged

andersonhc merged 2 commits into
py-pdf:masterfrom
RavSinghChandan:html-li-value

Conversation

@RavSinghChandan

Copy link
Copy Markdown

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/ folder

  • A mention of the change is present in CHANGELOG.md

  • This 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.

@RavSinghChandan

Copy link
Copy Markdown
Author

<li value="5"> was ignored, so an ordered list that sets an item's number, as HTML generators do when a list is split by other content, restarted from the wrong number. Browsers number that item 5 and the following items 6, 7, and so on. write_html() now does the same for ordered lists of any type (<ol type="i"> gives iv, v). An invalid value is ignored, and value on a <ul> item still has no effect, as in browsers. Added tests.

@andersonhc
andersonhc merged commit 822ce4f into py-pdf:master Oct 20, 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