docling-project / docling-project/docling
Inconsistent section_header vs list_item on deeply nested list items
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
I have a document with deeply nested list with subsections. Some of them are recognized as `section_header`, the other ones as `list_item`. This breaks formatting and my header aware chunking.
Highlighted items are `section_header`s, non-hightlighted are `list_item`s:
This results in bad md export:
```md
## 7.1. Do these data comply with the Data Access directive?
- 7.1.1. If the data are not to be made available to the public at all, or with limitations, has a Waiver (Appendix A of Data Access directive) been filed?
- 7.1.2. If there are limitations to public data access, describe how data are protected from unauthorized access or disclosure:
## 7.2. Name of organization of facility providing data access:
## 7.2.1. If data hosting service is needed, please indicate:
## 7.2.2. URL of data access service, if known:
https://marinecadastre.gov/data/
https://marinecadastre.gov/downloads/data/mc/SignificantWaveHeightDirection.zip
## 7.3. Data access methods or services offered:
## 7.4. Approximate delay between data collection and dissemination:
- 7.4.1. If delay is longer than latency of automated processing, indicate under what authority data access is delayed:
## 8. Data Preservation and Protection
The NOAA Procedure for Scientific Records Appraisal and Archive Approval describes how to identify, appraise and decide what scientific records are to be preserved in a NOAA archive.
- 8.1. Actual or planned long-term data archive location:
```
2 segments as an example:
```json
{
"self_ref": "#/texts/80",
"parent": {
"$ref": "#/groups/17"
},
"children": [],
"content_layer": "body",
"label": "list_item",
"prov": [
{
"page_no": 4,
"bbox": {
"l": 115.2,
"t": 366.224,
"r": 538.04,
"b": 342.398,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
0,
126
]
}
],
"orig": "7.1.2. If there are limitations to public data access, describe how data are protected from unauthorized access or disclosure:",
"text": "7.1.2. If there are limitations to public data access, describe how data are protected from unauthorized access or disclosure:",
"enumerated": false,
"marker": ""
},
{
"self_ref": "#/texts/81",
"parent": {
"$ref": "#/body"
},
"children": [],
"content_layer": "body",
"label": "section_header",
"prov": [
{
"page_no": 4,
"bbox": {
"l": 93.6,
"t": 314.665,
"r": 389.05,
"b": 305.57,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
0,
60
]
}
],
"orig": "7.2. Name of organization of facility providing data access:",
"text": "7.2. Name of organization of facility providing data access:",
"level": 1
},
```
### Steps to reproduce
Process this document: [5778.pdf](https://github.com/user-attachments/files/22259613/5778.pdf)
Exported docling json: [docling_data.json](https://github.com/user-attachments/files/22259629/docling_data.json)
### Docling version
```
Docling version: 2.51.0
Docling Core version: 2.47.0
Docling IBM Models version: 3.9.1
Docling Parse version: 4.4.0
Python: cpython-312 (3.12.11)
Platform: Linux-5.15.0-141-generic-x86_64-with-glibc2.34
```
### Python version
3.12.11
Contributor guide
Assessment
This issue has not been assessed yet.