#1663·xberg

bug: DOCX: list items are emitted as paragraph nodes in the document structure

Author: tobocop2Created Sep 18, 2026Updated Sep 19, 2026
LabelsbugP0

Description

List items in a DOCX come back as paragraph nodes in the document structure. No list or list_item node is emitted.

Expected: the three items form one list node with three list_item children. The List Bullet style in the python-docx default template carries a w:numPr numbering reference, so this is the ordinary Word list case. If the extractor only recognises lists through w:numId on the paragraph and this template attaches numbering through the style, the style-inherited case is the gap. Verify against a Word-authored file as well.

Steps to reproduce

  1. Build the file below.
  2. Extract it with include_document_structure = true.
  3. Read the nodes after the level-2 heading: three paragraph nodes with the item text.

Relevant files and configuration

xberg v1.2.4, 2026-09-18. Node type histogram for the whole file: group 6, heading 6, image 1, page_break 2, paragraph 6, raw_block 3, table 1.

python
from docx import Document
doc = Document()
doc.add_heading("Scope", 2)
for i in range(3):
    doc.add_paragraph(f"List item {i+1}", style="List Bullet")
doc.save("lists.docx")