# UnifiedWriter v5.33.0 DOCX Export Foundation

## Purpose

v5.33.0 starts the DOCX export path that is aligned with the UnifiedWriter Model-first editing policy.
The export path no longer depends on a simple HTML-to-DOCX shortcut as the canonical implementation.
Instead, it writes a minimal OOXML package directly with JSZip.

## Export architecture

```text
DocumentModel / rendered model HTML
  -> OOXML Export Mapper
  -> word/document.xml
  -> styles.xml / numbering.xml / rels / media
  -> .docx ZIP package
```

The current mapper supports a practical Level 1-2 subset:

- Paragraphs
- H1/H2/H3 paragraph styles
- Bold / italic / underline / strikethrough
- Superscript / subscript metadata
- Font size
- Text color
- Highlight color when it maps to Word highlight names
- Paragraph alignment
- Line spacing
- Paragraph left/right indentation
- Bullet and numbered lists
- Hyperlinks
- Inline data-url images written to `word/media/*`
- Basic tables, rows, and cells
- Cell width, background color, and colspan metadata where available
- Manual page breaks
- Page size / margin section properties for the active document page mode

## Design notes

The exporter intentionally keeps export diagnostics.  Unsupported structures are not silently converted into misleading Word constructs.
This makes future high-fidelity round-trip support safer because unsupported elements can be preserved or upgraded deliberately.

## Known limitations

The following areas are still future work:

- Full comments.xml export
- Footnotes / endnotes
- Header / footer editing and export
- Floating images and text wrapping
- Full table grid model with complex merge preservation
- Track changes
- Unknown OOXML part preservation during import -> edit -> export
- DOCX export of every CSS style used by the browser renderer

## Why this matters

A complete UnifiedWriter DOCX implementation must eventually control OOXML package parts directly.
The v5.33.0 exporter establishes that direction while keeping the current Model-first HTML bridge usable during development.
