Repository navigation
2.0.0 (2026-11-29)
html-to-docx 2.0 is a modernized release: TypeScript, ES module + CommonJS + browser builds with bundled type definitions, no Node polyfills in the browser, and a long list of conversion fixes. The HTMLtoDOCX(htmlString, headerHTMLString, documentOptions, footerHTMLString) API and its options are unchanged.
Upgrading from 1.x: read MIGRATION.md. In short: Node.js 22+, no UMD build (use import / require of the package), remove browser polyfills and @types/html-to-docx. The generated documents change where 1.x was wrong: see "Document output changes" in the guide.
Highlights since 1.8.0 (details in the 2.0.0-beta.1 and 2.0.0-beta.2 notes):
- Documents Word refused to open now open (partial margins, empty rows, merged cells, table grids).
- No more lost content: several paragraphs per list item, links and images inside inline elements, and more.
- Inline formatting (
em,ins,s/del,mark,code, nested tags), whitespace, fonts for accented and CJK text, and table widths and borders now match the HTML. - Images that can't be loaded are skipped with a warning instead of failing the conversion.
- New option
table.row.repeatTableHeaderrepeats<thead>rows on each page. - Smaller package: 261 KB packed, no source maps.
Performance Improvements
- leave source maps out of the npm package (565d372)