Skip to content

write_html: keep the default bullet for an empty or unknown <ul type> - #2055

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:html-ul-unknown-type
Oct 24, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:html-ul-unknown-type

Conversation

@RavSinghChandan

Copy link
Copy Markdown

An empty or unknown type on a <ul>, such as type="" or a misspelled type="disk", made write_html() raise NotImplementedError: Unsupported type. Browsers ignore it and keep the default disc, and write_html() already does the same for an unknown <ol type>.

write_html() now keeps the default bullet (ul_bullet_char) for such a type. A known keyword, in any case, and a single character used as the bullet work as before, and an invalid ul_bullet_char passed to write_html() still raises, because the fallback only applies to the HTML attribute. Added tests for empty, blank and unknown types, and for the fallback to a custom ul_bullet_char.

@andersonhc
andersonhc merged commit ed79375 into py-pdf:master Oct 24, 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