Repository navigation
fix: adapt backends and ground truth to docling-core serializer improvements - #5643
Conversation
|
✅ DCO Check Passed Thanks @ceberam, all your commits are properly signed off. 🎉 |
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 Require two reviewer for test updatesWhen test data is updated, we require two reviewers
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
463daa6 to
ecbe492
Compare
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
ecbe492 to
5bb668a
Compare
AI triage (advisory)Checked commit The PR raises the CI safety: needs maintainer care before you approve CI.
4 related pull request(s) in the same code
Reference data changes
Only the first 80 of 99 reference files were compared. Assessment: unclear. The reading order changes in The |
There was a problem hiding this comment.
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.
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>
e9bc511 to
24dd7e4
Compare
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_listnow detects this pattern via the new_is_invisible_wrapper_listhelper 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-typevalues 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_TAGSfrozenset constant (and_LIST_AND_TABLE_TAGSfor the one site that also includes"table").JATS backend (
docling/backend/xml/jats_backend.py)The new Markdown serializer renders a
ListItemwithtext=""and a plainTextItemchild as a continuation block (- \n\n text) rather than inline text._add_footnote_groupwas building list items this way._emit_inlinegains analways_groupkeyword argument. WhenTrue, it wraps even a single segment in anInlineGroup. Because the serializer only treats the first child as inline text when it is anInlineGroup, passingalways_group=Truefrom_add_footnote_grouprestores correct single-line rendering while keeping theFOOTNOTE-labelled child items and their content layers intact.Ground truth regeneration
All
.md,.json,.yaml, and.itxtfixture files affected by three serializer improvements in the new docling-core were regenerated:python,sql).The
test_jats_plain_footnote_without_styling_stays_a_single_text_itemtest 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_paragraphboxnote test and the equivalenttest_chandra_list_item_text_keeps_boundary_before_inline_paragraphtest were updated to reflect that a list item containing two separate paragraph nodes now renders as- Intro\n\n more **x** yrather than merging them on one line.Documentation build fix
CI step
build-docs / buildfailed withRuntimeError: redirect output 'usage/index.html' collides with a page.mkdocs.ymlredirectsusage/index.mdtogetting_started/quickstart.md, but the orphaned pagedocs/usage/index.mdstill existed. It is not in the nav. The zensical version inuv.lock(0.0.74, up from 0.0.52) now rejects this clash.docs/usage/index.md. Its only unique content, the "Releasing input resources" section (added in feat(api): add InputDocument.release() #3600), now sits indocs/usage/advanced_options.mdunder "Limit resource usage". This section was never reachable on the published site before./usage/URL (linked from the README) still works.Notes
docling-core is now required as
>=2.109.0inpyproject.toml(
dependencies,feat-chunking,pr-fast-checks).uv.lockis updated to match.