Skip to content

fix: html serialization of lists with mixed markers - #701

Open
julianfesel wants to merge 3 commits into
docling-project:mainfrom
julianfesel:fix/#699-html-serialization-list-markers
Open

fix: html serialization of lists with mixed markers#701
julianfesel wants to merge 3 commits into
docling-project:mainfrom
julianfesel:fix/#699-html-serialization-list-markers

Conversation

@julianfesel

Copy link
Copy Markdown

This PR implements option 1 of issue #699

HTML list items with an empty marker now render with list-style-type: none; when original markers are being shown, so the browser no longer invents numbering that is not present in the DoclingDocument.

Changes

  • Updated HTMLTextSerializer to suppress default list markers for unmarked list items while preserving explicit markers.
  • Added a regression test for a mixed enumerated/non-enumerated list group.
  • Refreshed the affected HTML and chunker goldens to match the new serializer output.

Signed-off-by: Fesel Julian <78921234+julianfesel@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @julianfesel, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@dolfim-ibm

Copy link
Copy Markdown
Member

@julianfesel are all the changes produced on the test files what you would expect?

Signed-off-by: Fesel Julian <78921234+julianfesel@users.noreply.github.com>
Signed-off-by: Fesel Julian <78921234+julianfesel@users.noreply.github.com>
@julianfesel

Copy link
Copy Markdown
Author

@julianfesel are all the changes produced on the test files what you would expect?

@dolfim-ibm

For show_original_list_item_marker=True, yes. However, based on your comment, I realized that I had misunderstood the role of marker: "" in Docling. I did not realize that it is not nullable.

In the new commits, I narrowed the application of strict markers to enumerated lists that contain at least one detected marker. As a result, there is now only one change in the test cases, which I believe is correct.

In my opinion, automatic enumeration does not make sense when at least one numeric marker is present. At the very least, this would require a more detailed validation. In such cases, one cannot assume that the default enumeration is correct. Furthermore, especially in OCR scenarios, the marker may actually be part of the text itself.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

HTML serializer introduces browser-generated markers for list items without a detected marker

2 participants