Skip to content

Adding numbered list to an imported docx causes export to not load in Word #3773

Description

@jkgfullstop

What happened?

When importing a docx made in Word that does not contain a numbered list, then adding the first numbered list in the super-editor, and exporting the docx, the docx cannot be opened in Word and cannot be repaired. The docx renders fine in super editor. This has to do with how super editor is creating that numbered list without the w16cid namespace for w:numbering.

Steps to reproduce

  1. Create a blank Word document
  2. Import it into Super Editor
  3. Add a numbered list
  4. Export to DOCX
  5. Open in Word - Fails to Open

SuperDoc version

1.43.1

Browser

Chrome

Additional context

This happens because the XML namespace for w:numbering does not contain the w16cid and w16cex namespaces in the <w:numbering> declaration, but uses at least w16cid:durableId.

Adding those namespaces to the NUMBERING_ROOT_ATTRS in packages/super-editor/src/editors/v1/core/parts/adapters/numbering-part-descriptor.ts makes things export properly.

  'xmlns:w16cid': 'http://schemas.microsoft.com/office/word/2016/wordml/cid',
  'xmlns:w16cex': 'http://schemas.microsoft.com/office/word/2018/wordml/cex',

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions