Repository navigation
v2.0.0-beta.1
Pre-release
Pre-release
2.0.0-beta.1 (2026-11-27)
⚠ BREAKING CHANGES
- requires a runtime with global structuredClone (Node.js 17+, all current browsers); Node.js 22+ is already required.
- the UMD build (dist/html-to-docx.umd.js) is removed and Node.js 22+ is required. Use the package entry point (
import/require('html-to-docx')); browser bundlers automatically use the new self-contained browser build, so remove any Node polyfills added for 1.x. See MIGRATION.md.
Features
- TypeScript type definitions, ES module and CommonJS builds, and a self-contained browser build selected through the
browserexport condition (fixesClass extends value undefined is not a constructor or null, #128, #242) - add Buffer-free base64 helpers (19d06d2)
- test cases (712c887)
Bug Fixes
- apply max width and height style to img tag correctly (e17a3f3)
- calculate max width and max height absolute values and then do comparison (4dd20e8)
- detect Buffer and Blob via globalThis (34d69ee)
- handle max check handle properly (cb31fe1)
- list styling to support adding different list padding (230dd84)
- produce an empty document for empty HTML, reject non-strings (068c836)
- refator common code to a separate function (13aaaf9)
- skip images that cannot be loaded or read instead of failing (751dccb)
Code Refactoring
- replace lodash cloneDeep with structuredClone (ac4cde9)
Build System
- replace Rollup with tsdown and ship dual ESM/CJS (703e22d)