Skip to content

Recover nesting for style-only lists (List Bullet 2 / List Number 2 without numbering refs) #1

Description

@Tishinator

Problem

Lists built purely from paragraph styles like List Bullet 2 / List Number 3 — with no numPr/ilvl numbering references — convert as flat, separate lists instead of nested ones. Real Word-authored lists carry numbering definitions and nest correctly; this only affects documents where the style alone implies the level. See the degraded.docx fixture ("Style-only lists" section) and decision log D12.

Proposed fix

Extend src/docx2md/preprocess.py (same technique as the monospace→code pre-pass):

  1. Detect paragraphs whose pStyle matches List (Bullet|Number)( \d)?.
  2. Inject a multilevel abstractNum/num definition into word/numbering.xml (the fixture generator in scripts/make_fixtures.py already builds exactly this XML).
  3. Stamp numPr with numId + ilvl derived from the style suffix onto those paragraphs, one numId per contiguous list group.

Pandoc then nests correctly — verified during the feasibility spike.

Acceptance

  • New fixture with style-only nested bullet + ordered lists converts with correct nesting.
  • Existing lists.docx golden output unchanged.
  • Remove the corresponding entry from README known limitations.

Priority: highest of the known issues — it is the only one that loses document structure rather than styling.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions