Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @bercedev, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The Markdown backend now keeps the original source of each HTML block. It puts that source back in place of the marked code block. This stops the escaped HTML from the serializer from turning HTML tables into text items. CI safety: no concern found. A maintainer must still approve CI. Possible duplicates
2 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): blocker found
This review covers the full diff at ba7f0289ab. It read the code and did not run it.
The Markdown HTML block fix restores original HTML block content correctly. The PR branch includes unrelated OpenDocument backend changes from PR #4956 that you must remove before merge.
A maintainer makes the merge decision. This review never approves the pull request.
| return _normalize_odf_text_runs(runs) | ||
|
|
||
|
|
||
| def _odf_list_headings(odf_list: OdfList) -> list[Header]: |
There was a problem hiding this comment.
blocker: Unrelated OpenDocument changes included in Markdown pull request
The pull request title and description target the Markdown HTML block restoration fix (#4982). The branch also contains changes to docling/backend/opendocument_backend.py and tests/test_backend_opendocument.py from PR #4956.
Merging this pull request will merge OpenDocument list-heading changes under the fix(md) scope.
Rebase the branch onto main and drop the commits that belong to PR #4956.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ity policy on PyPI docling-core 2.104.0, the first version that allows Pillow 13, escapes the text of code blocks in its HTML serializer (docling-project/docling-core#894). Docling's Markdown backend passes each HTML block through a code block, so an HTML block in a Markdown file, e.g. a table, now comes out as its markup, and Document.from_docling() gives one paragraph of that text where it gave a table header and a paragraph for each row. The changelog lists it under Known issues, with the report to Docling (docling-project/docling#4982), and says that upgrading to a Docling release that reads the HTML blocks as before brings the earlier paragraphs back, without a new release of ContextGem. The fix proposed in docling-project/docling#4984 was checked against that: applied to Docling 2.142.0 with docling-core 2.104.0, it gives the outputs committed before the regression for mixed.md, nested.md and signature_stamp_01.md, and for escaped_characters.md all but the inline code, whose entities docling-core now keeps on purpose. It is not merged, so the changelog does not name a release. [project.urls] has a Security entry for SECURITY.md, which PyPI shows next to the changelog from this release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: berce <75228263+bercedev@users.noreply.github.com>
ba7f028 to
ddc7f3b
Compare
Issue resolved by this Pull Request:
Resolves #4982
The Markdown backend hides each HTML block in a code item, serializes the document to HTML, then strips the
<pre><code>and markers to get the HTML back. Since docling-core 2.104.0 escapes code text in the HTML serializer (docling-project/docling-core#894), what came back was<table>…, so the block ended up as a text item instead of a table.Instead of stripping the markers around whatever the serializer produced, each marked code block is now replaced with the HTML block's original source, kept in order when the block is read. That works the same with docling-core 2.103.x and 2.104.0, and doesn't unescape anything twice (an entity inside the original HTML, like
&, stays an entity). The block count check is kept.#4848 rewrites this path and would also cover it; this is the small fix for the regression in the meantime.
Checklist:
test_html_block_becomes_a_table_with_its_entities_intact(a table withA & Bin a header) fails on main with docling-core 2.104.0 and passes with this.tests/test_backend_markdown.py: with docling-core 2.103.1, 43 passed; with 2.104.0, 42 passed andtest_convert_validfails only onescaped_characters.md, the plain-text& <export change in 2.104.0, which fails on main too and isn't about HTML blocks (mixed.md,nested.mdandsignature_stamp_01.mdfrom the issue pass again). ruff check/format clean.