docling-project / docling-project/docling

DOCX: list item silently dropped when a list returns to an indent level it started above

Open
#4,185 0 comments 0 reactions 0 assignees View on GitHub
bug docx
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
A numbered list whose items start at indent level 1 or deeper loses every item that returns to its
**starting** level after going deeper. The backend logs

```
Parent element of the list item is not a ListGroup. The list item will be ignored.
```

and discards the paragraph. Whole text gets lost there.

### Steps to reproduce
The document has to have three items in a Word list (`numId=1`) at indent levels **1, 2, 1** and never use indent level 0 (see an attached file).

Run:

```python
from docling.document_converter import DocumentConverter

doc = DocumentConverter().convert("docling_listgroup_repro.docx").document
print(doc.export_to_markdown())
print("Item C present?", any("Item C" in t.text for t in doc.texts))
```

Expected: three list items.

Result:

```
- Item A at indent level 1. This one survives.

- Item B at indent level 2. This one survives.

Item C present? False
```

Meaning 3rd item is unavailable.

Changing the levels to **0, 1, 2, 1** makes the bug disappear, which isolates the cause: the list must
*start* at an indent level above 0.

### Docling version
2.126.0

### Python version
Python 3.14.6

[docling_listgroup_repro.docx](https://github.com/user-attachments/files/31883075/docling_listgroup_repro.docx)

Contributor guide

Open the contributing guide

Research direction

Start with the DocumentConverter conversion path using the attached DOCX, and reproduce the case with list indentation 1, 2, 1 and numId=1. Compare the converted document and exported Markdown with the log message about a non-ListGroup parent. Done means all three list items are retained and Item C is present in doc.texts and the Markdown output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.