Skip to content

DOCX bullet numbering level text renders XML numeric character reference literally #9

Description

@guilhermesimas

Hello folks.

Thank you for making extend-ui OSS.

I'm having trouble getting bullet points to render correctly in docx.

The example below renders correctly as • in word while Extend renders •.

minimal-docx-bullet-entity-repro.docx

More details (AI-generated) below:

Summary

DOCX files whose word/numbering.xml stores bullet marker text as a numeric XML character reference render the literal entity text in @extend-ai/react-docx.

For example, a valid numbering level like:

<w:lvlText w:val="•"/>

is parsed into the document model as:

text: "•"

and renders visibly as &#8226; instead of the bullet character .

Expected behavior

The numbering level text should be decoded according to XML attribute semantics, so &#8226; becomes .

Actual behavior

The model preserves the raw entity string, and list markers render as visible text like:

•First bullet item

Reproduction

Create a DOCX with:

  • word/document.xml paragraphs using w:numPr
  • word/numbering.xml with a bullet level:
    <w:numFmt w:val="bullet"/>
    <w:lvlText w:val="&#8226;"/>

Then parse/render with @extend-ai/react-docx@0.7.1.

Observed parsed model excerpt:

{
"format": "bullet",
"text": "•"
}

If the same DOCX is rewritten so w:lvlText contains the literal bullet character:

<w:lvlText w:val="•"/>

the parsed model becomes:

{
"format": "bullet",
"text": "•"
}

and the list renders correctly.

Notes

This looks specific to DOCX numbering level marker text parsing. Normal XML parsers decode numeric character references in attribute values, so the parser/model builder likely needs to decode w:lvlText/@w:val before storing it in NumberingLevelDefinition.text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions