Skip to content

DOCX: bullet marker characters (lvlText) from numbering.xml ignored #105

@developer0hye

Description

@developer0hye

Description

DOCX bullet lists always render with Typst's default markers (-) regardless of the custom bullet characters defined in numbering.xml. The lvlText values (e.g., , , ) are not read or applied.

Root Cause

In crates/office2pdf/src/parser/docx.rs, build_num_kind_map() (line ~62) only determines whether a list is Ordered or Unordered by checking if the format is "bullet". The actual lvlText value that defines the marker character is never extracted.

The codegen (crates/office2pdf/src/render/typst_gen.rs line ~1197) then uses Typst's #list() for unordered lists, which renders with the default - marker.

numbering.xml example:

<w:abstractNum w:abstractNumId="1">
  <w:lvl w:ilvl="0">
    <w:numFmt w:val="bullet"/>
    <w:lvlText w:val=""/>       <!-- filled circle -->
    <w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr>
  </w:lvl>
  <w:lvl w:ilvl="1">
    <w:numFmt w:val="bullet"/>
    <w:lvlText w:val=""/>       <!-- open circle -->
    <w:pPr><w:ind w:left="1440" w:hanging="360"/></w:pPr>
  </w:lvl>
  <w:lvl w:ilvl="2">
    <w:numFmt w:val="bullet"/>
    <w:lvlText w:val=""/>       <!-- filled square -->
    <w:pPr><w:ind w:left="2160" w:hanging="360"/></w:pPr>
  </w:lvl>
</w:abstractNum>

Expected

  • Level 0: Item text
  • Level 1: Sub-item text
  • Level 2: Sub-sub-item text

Actual

All levels render with -:

  • - Item text
    • - Sub-item text
      • - Sub-sub-item text

Fix Suggestion

  1. Extract lvlText from numbering definitions and store per-level marker info
  2. Extend the IR List or ListItem to carry custom marker characters
  3. In Typst codegen, use #list(marker: [●]) or #set list(marker: [●]) to override default markers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions