Skip to content

fix: restore active list item font styling for bullet prefixes after headings (#1921) - #1923

Merged
andersonhc merged 2 commits into
py-pdf:masterfrom
prateek-dagar:fix-issue-1921
Sep 2, 2026
Merged

fix: restore active list item font styling for bullet prefixes after headings (#1921)#1923
andersonhc merged 2 commits into
py-pdf:masterfrom
prateek-dagar:fix-issue-1921

Conversation

@prateek-dagar

Copy link
Copy Markdown

Fixes #1921

Changes

  • Synchronized the active text styling to self.pdf at the start of _new_paragraph() so that paragraph prefix bullets/numbers evaluate with the correct font metrics rather than inheriting preceding tag styles (like <h1>).
  • Restored original font attributes after paragraph initialization to avoid writing redundant Tf stream commands, preserving legacy test hashes.

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.

Comment thread fpdf/html.py

@andersonhc andersonhc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge. Thanks @prateek-dagar

@andersonhc
andersonhc merged commit a4e8a23 into py-pdf:master Sep 2, 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.

Ordered list bullets render with h1 styling using write_html()

2 participants