Repository navigation
Conversation
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
|
✅ DCO Check Passed Thanks @matt8s, 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 This PR adds the option CI safety: no concern found. A maintainer must still approve CI. 1 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 916a9fc84a. It read the code and did not run it.
The change reaches beyond the opt-in flag. _MarkdownTextSerializer now rewrites every newline in non-code text during the HTML round trip, even when enable_latex_math is False. The reviewer must check whether the default Markdown behavior changes for documents that contain an HTML block.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the changes since 916a9fc84a at df25ae57b5. It read the code and did not run it.
The incremental change disables hard-break replacement during HTML round trips when the document contains no formulas. I checked docling/backend/utils/markdown_html.py and the new tests in tests/test_backend_markdown.py for regressions in math-free Markdown conversions.
Earlier findings
- fixed (question): Hard-break handling in the HTML round trip is not gated by
enable_latex_math
A maintainer makes the merge decision. This review never approves the pull request.
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Signed-off-by: Matthew Emerson Spotnitz, PhD <mespotnitz@gmail.com>
Markdown VLM responses currently enter the ordinary Markdown backend. LaTeX escapes and underscores can become prose formatting, and an internal HTML conversion can flatten formulas.
Add
MarkdownBackendOptions.enable_latex_math, defaulting toFalse. Enable it for Markdown responses inVlmPipeline. Reuse the shared math extension and retain the backend's GFM dialect.The backend creates typed formulas with literal LaTeX bodies. Display formulas keep their scope through emphasis, links, headings, lists and rich table cells. Document-local references carry formulas and hard breaks through the internal HTML conversion while preserving HTML formatting, real links and pictures. Code spans remain literal.
Resolves #5224.
Checklist:
Review evidence:
Tests check literal formula bodies, inline/display scope, tree ownership, cell reading order, hard breaks, formatting, links and exports. Controls cover ordinary Markdown, currency, code, optional imports, cached parser modes and concurrent conversions. The VLM test uses a synthetic response and does not load a model. No reference data changed.
The existing GFM pipe-escape layer still applies: write
\\|in a cell to supply LaTeX\|. Recognition inside opaque raw HTML blocks and the existing delimiter policy are unchanged.At
916a9fc, the isolated branch passed 550 tests, with one Chromium-dependent test skipped:make validateand the applicable hooks on the actual committed file list passed. The documentation build passed. Validation used Python 3.12.14, docling-core 2.106.0 and locked Marko 2.2.4.The full suite was not run on this isolated branch. Broader local testing found a legacy PowerPoint reference mismatch that also occurs on unchanged upstream. The default 1000-line check has pre-existing violations; the configured changed-file CI hooks pass.
Default-mode follow-up
Commit
df25ae5limits hard-break placeholders to documents with typed formulas. Six new cases compare math-freetext,orig, and exact Markdown export with baseline behavior, with the option both enabled and disabled. The affected five-file suite passed 202 tests, andmake validatepassed. See the review-thread reply for the command and before/after comparison.Upstream compatibility follow-up
Merged upstream
896f2fdadditively ata79e92band retained both sets of Markdown tests. The existing math AST helpers moved tomarkdown_math.pyin821390a; the combined backend stays below the 1,500-line limit, with lazy loading through the existing optional-dependency guard. The helper move passed 166 affected tests, including optional-dependency checks. After merging upstream, the Markdown backend, math utility and VLM math-export suites passed 183 tests.make validatepassed for both changes.