You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chandra and Nemotron section headings export one level too deep #4902
Chandra HTML headings and Nemotron Parse 2.0 Markdown section headings export one level too deep. Their parsers store the source H1–H6 number directly in SectionHeaderItem.level, but Docling reserves the title level: section level 1 exports as ##.
Steps to reproduce
Parse Chandra <div data-bbox="100 100 900 200" data-label="Section-Header"><h3>Method</h3></div> with parse_chandra_html.
Or parse <x_0.2><y_0.2>### Method<x_0.8><y_0.4><class_Section-header> with parse_nemotron_parse_v2.
Call document.export_to_markdown().
Actual: #### Method. Expected: ### Method, with the original text and coordinates retained.
The HTML correction belongs in the shared Chandra HTML mapper, including callers that reuse _add_html_fragment. Nemotron needs the same conversion for its native Markdown envelope. DOTS already converts its native heading depth correctly. The LightOnOCR work in #4789 found this mismatch; its local compensating pass should be removed when the shared mapper is corrected.
Docling version
Current main d01c9c0991920924cf17f6b8366079ac035ffc38 (2.140.0); reproduced locally on Python 3.12.
Activity
refactor: reuse shared VLM math and heading handling
fix: preserve VLM section heading depth in exports
refactor: reuse shared VLM math and heading handling