Skip to content

fix: adapt backends and ground truth to docling-core serializer improvements - #5643

Merged
ceberam merged 5 commits into
mainfrom
deps/update-core
Dec 1, 2026
Merged

ceberam merged 5 commits into
mainfrom
deps/update-core

Conversation

@ceberam

@ceberam ceberam commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

This PR updates docling to be compatible with the changes in docling-core release 2.109.0.

Changes

HTML backend (docling/backend/html_backend.py)

Some HTML documents produced by CMSs wrap list children in invisible <li style="list-style-type: none"> items to introduce extra indentation. The HTML backend was treating these as real list items, adding a spurious empty list group that the new Markdown serializer exposed as a double-indented empty bullet.

_handle_list now detects this pattern via the new _is_invisible_wrapper_list helper and promotes the sublists directly under the current parent, eliminating the extra nesting level.

As part of this work, the two module-level regex constants used to detect list-style-type values were replaced by _inline_css_property, a small helper that parses inline CSS declarations with plain string operations. The repeated {"ul", "ol", "dl"} literal was extracted to the _LIST_TAGS frozenset constant (and _LIST_AND_TABLE_TAGS for the one site that also includes "table").

JATS backend (docling/backend/xml/jats_backend.py)

The new Markdown serializer renders a ListItem with text="" and a plain TextItem child as a continuation block (- \n\n text) rather than inline text. _add_footnote_group was building list items this way.

_emit_inline gains an always_group keyword argument. When True, it wraps even a single segment in an InlineGroup. Because the serializer only treats the first child as inline text when it is an InlineGroup, passing always_group=True from _add_footnote_group restores correct single-line rendering while keeping the FOOTNOTE-labelled child items and their content layers intact.

Ground truth regeneration

All .md, .json, .yaml, and .itxt fixture files affected by three serializer improvements in the new docling-core were regenerated:

  • List item continuation blocks are now correctly indented inside nested lists.
  • Code fence language tags are inferred from block content (e.g. python, sql).
  • Deeply nested list items carry proper Markdown indentation prefixes.

The test_jats_plain_footnote_without_styling_stays_a_single_text_item test was updated to drop an assertion on the absence of inline groups, which was an implementation detail of the previous single-segment code path.

The test_list_item_text_keeps_boundary_before_rich_paragraph boxnote test and the equivalent test_chandra_list_item_text_keeps_boundary_before_inline_paragraph test were updated to reflect that a list item containing two separate paragraph nodes now renders as - Intro\n\n more **x** y rather than merging them on one line.

Documentation build fix

CI step build-docs / build failed with RuntimeError: redirect output 'usage/index.html' collides with a page.

  • Cause: mkdocs.yml redirects usage/index.md to getting_started/quickstart.md, but the orphaned page docs/usage/index.md still existed. It is not in the nav. The zensical version in uv.lock (0.0.74, up from 0.0.52) now rejects this clash.
  • Fix: I removed docs/usage/index.md. Its only unique content, the "Releasing input resources" section (added in feat(api): add InputDocument.release() #3600), now sits in docs/usage/advanced_options.md under "Limit resource usage". This section was never reachable on the published site before.
  • The redirect stays, so the /usage/ URL (linked from the README) still works.

Notes

docling-core is now required as >=2.109.0 in pyproject.toml
(dependencies, feat-chunking, pr-fast-checks). uv.lock is updated to match.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

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

@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 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)(?:\(.+\))?(!)?:

🟢 Require two reviewer for test updates

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.96721% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling/backend/html_backend.py 81.66% 3 Missing and 8 partials ⚠️

📢 Thoughts on this report? Let us know!

@ceberam
ceberam force-pushed the deps/update-core branch 2 times, most recently from 463daa6 to ecbe492 Compare November 27, 2026 16:45
@ceberam ceberam changed the title fix: adapt backends and ground truth to docling-core Markdown serializer improvements fix: adapt backends and ground truth to docling-core serializer improvements Nov 27, 2026
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
@ceberam
ceberam requested review from PeterStaar-IBM, cau-git and dolfim-ibm and removed request for PeterStaar-IBM December 1, 2026 14:46
@ceberam
ceberam marked this pull request as ready for review December 1, 2026 14:46
cau-git
cau-git previously approved these changes Dec 1, 2026
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI bug Something isn't working dependency mgmt documentation Improvements or additions to documentation html issue related to html backend jats issue related to JATS XML backend priority:low xml issue related to supported schema-specific XML formats labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 24dd7e4b55. The analysis read the diff only. It did not run code from this pull request.

The PR raises the docling-core minimum to 2.109.0 and adapts the HTML and JATS backends to its new Markdown serializer. The HTML backend now flattens invisible list-style-type: none wrapper lists. JATS footnote items are now always wrapped in an inline group. The PR also regenerates reference data and tests, and moves the release() docs from docs/usage/index.md to docs/usage/advanced_options.md. It deletes docs/usage/index.md.

CI safety: needs maintainer care before you approve CI.

  • pyproject.toml: changes build, dependency, or tool configuration
  • uv.lock: changes locked dependencies
4 related pull request(s) in the same code
PR State Signal Assessment
#5673 open changes the same code related: It adds inline SVG support to html_backend.py. This PR changes list handling in the same file. The two fix different problems.
#5684 open changes the same code related: It removes ruby readings in html_backend.py. This PR changes list handling in the same file. The two fix different problems.
#5536 open changes the same code related: It adds a wikitext backend. Its diff also changes HTML math spans, figure captions and description lists. Only the shared file overlaps. The changes are different.
#3600 merged referenced as #3600 related: It is merged and added the release() docs to docs/usage/index.md. This PR moves the same text to docs/usage/advanced_options.md. The PR does not repeat the change of #3600.

Reference data changes

Change Files
structure 2
tables 1
text 77
  • structure tests/data/html/groundtruth/example_07.html.json: reading order changed
  • structure tests/data/jats/groundtruth/elife-56337.nxml.json: reading order changed
  • tables tests/data/docx/groundtruth/docx_checkboxes.docx.json: table 0: 2 cell(s) changed
  • text tests/data/asciidoc/groundtruth/asciidoc_03.asciidoc.md: line or paragraph breaks changed
  • text tests/data/docx/groundtruth/Strict.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/Transitional.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/content_control_with_picture.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_code_blocks.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_code_blocks.docx.md: +2 / -2 lines
  • text tests/data/docx/groundtruth/docx_comments.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_external_image.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_grouped_images.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_list_blank_spacer.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_list_east_asian_num_fmt.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_list_resumed_after_table.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_list_resumed_numbering.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_lists.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_page_header_footer_first_page.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_rich_cells.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_rich_tables_01.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_sdt_table_cells.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_symbol_font_glyphs.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_vml_images.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/docx_wrapped_table_rows.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/drawingml.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/equations.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/list_after_num_headers.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/lorem_ipsum.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/omml_frac_superscript.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/omml_func_log.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/omml_multi_equation_paragraph.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/omml_text_escapes_in_math.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/table_with_equations.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/tablecell.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/test_emf_docx.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/textbox.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/unit_test_formatting.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/unit_test_headers.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/unit_test_headers_numbered.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/word_image_anchors.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/word_sample.docx.json: item attributes changed
  • text tests/data/docx/groundtruth/word_tables.docx.json: item attributes changed
  • text tests/data/html/groundtruth/example_01.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_02.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_03.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_04.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_05.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_06.html.json: item attributes changed
  • text tests/data/html/groundtruth/example_07.html.itxt: +7 / -9 lines
  • text tests/data/html/groundtruth/example_07.html.md: line or paragraph breaks changed
  • text tests/data/html/groundtruth/example_08.html.json: item attributes changed
  • text tests/data/html/groundtruth/formatting.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_code_snippets.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_code_snippets.html.md: +1 / -1 lines
  • text tests/data/html/groundtruth/html_description_list.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_heading_in_p.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_inline_group_in_table_cell.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_nested_block_in_list_item.html.json: item attributes changed
  • text tests/data/html/groundtruth/html_nested_block_in_list_item.html.md: line or paragraph breaks changed
  • text tests/data/html/groundtruth/html_rich_table_cells.html.json: item attributes changed
  • … 20 more file(s) not listed

Only the first 80 of 99 reference files were compared.

Assessment: unclear. The reading order changes in example_07.html.json and elife-56337.nxml.json match the HTML and JATS code changes. The docx and latex changes have no matching backend change in this PR. The docx_checkboxes.docx.json table cell change has no matching backend change either. These changes may come from the new docling-core serializer, but the evidence does not confirm it.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI first review (advisory): blocker found

This review covers the full diff at e9bc511732. It read the code and did not run it.

The main risk is severe content loss in the HTML backend during list conversion. The human reviewer must check that text within inline formatting tags is not dropped. This pull request also lacks focused regression tests for the new list-wrapper optimization.

A maintainer makes the merge decision. This review never approves the pull request.

Comment thread docling/backend/html_backend.py Resolved
Comment thread docling/backend/html_backend.py Resolved
@github-actions github-actions Bot added the ai:review-changes AI first review suggests changes label Dec 1, 2026
dolfim-ibm
dolfim-ibm previously approved these changes Dec 1, 2026
A <ul> whose only children are <li style="list-style-type: none"> items
with no visible text is a pure indentation device. _handle_list now
promotes the sublists directly under the current parent, eliminating a
spurious extra nesting level that the new docling-core Markdown serializer
exposed as a double-indented empty bullet.

Also introduces _inline_css_property to parse inline style declarations
without regex, replaces _LIST_STYLE_STRING_RE and _LIST_STYLE_NONE_RE,
adds _LIST_TAGS and _LIST_AND_TABLE_TAGS module constants.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
…ntinuation blocks

The new docling-core Markdown serializer renders a list item with text=""
and a plain TextItem child as a continuation block instead of inline text.
_emit_inline now accepts always_group=True to force an InlineGroup wrapper
even for a single segment; _add_footnote_group passes this flag so the
group is recognized as inline content by the serializer.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
…provements

Updates .md fixture files affected by three serializer changes in the new
docling-core: list item continuation blocks are now correctly indented,
code fence language tags are inferred from content, and deeply nested
list items carry proper Markdown indentation.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
The `usage/index.md` redirect collided with the `docs/usage/index.md`
page, which made `zensical build` fail. Remove the orphaned page and
move its "Releasing input resources" section to advanced options.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
@ceberam
ceberam dismissed stale reviews from dolfim-ibm and cau-git via 24dd7e4 December 1, 2026 15:13
@github-actions github-actions Bot added ai:ci-needs-care AI triage: check CI-safety findings before you approve CI and removed ai:ci-needs-care AI triage: check CI-safety findings before you approve CI ai:review-changes AI first review suggests changes labels Dec 1, 2026
@ceberam
ceberam merged commit d84605b into main Dec 1, 2026
54 checks passed
@ceberam
ceberam deleted the deps/update-core branch December 1, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ci-needs-care AI triage: check CI-safety findings before you approve CI bug Something isn't working dependency mgmt documentation Improvements or additions to documentation html issue related to html backend jats issue related to JATS XML backend priority:low xml issue related to supported schema-specific XML formats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants