@yinyoudexing/xml2word 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,8 +104,11 @@ fs.writeFileSync("out.docx", buf);
|
|
|
104
104
|
|
|
105
105
|
## HTML 支持范围(当前版本)
|
|
106
106
|
|
|
107
|
-
- 支持:`p/span/strong/br`、`h1~h6`、`ul/ol/li`、`table/tr/td/th`
|
|
108
|
-
- 支持:`
|
|
107
|
+
- 支持:`div/p/span/strong/em/u/br`、`h1~h6`、`ul/ol/li`、`table/tr/td/th`
|
|
108
|
+
- 支持:`img(src=dataURL)`、`canvas(data-image=dataURL)`
|
|
109
|
+
- 支持:`text-align`、`vertical-align`、`font-size(pt/px)`、`color(rgb/#)`、`font-family`
|
|
110
|
+
- 支持:`background-color/background`(段落/单元格底色)、`white-space: nowrap`(表格单元格)
|
|
111
|
+
- 支持:表格边框(solid/dashed/dotted/double)、表格按内容估算列宽
|
|
109
112
|
- 支持分页标记(会插入 Word 分页符):
|
|
110
113
|
- `<div class="page-break"></div>`
|
|
111
114
|
- `<hr class="page-break" />`
|
|
@@ -113,6 +116,6 @@ fs.writeFileSync("out.docx", buf);
|
|
|
113
116
|
- 会跳过:`canvas`、编辑器辅助 DOM(如 ProseMirror widget)
|
|
114
117
|
|
|
115
118
|
限制(需要额外实现才能完全还原):
|
|
116
|
-
-
|
|
119
|
+
- CSS 选择器:不解析 `<style>`,只读取标签上的 `style=""` 行内样式
|
|
117
120
|
- 复杂 CSS:比如浮动/定位/复杂布局无法直接映射到 Word
|
|
118
121
|
- 精准“自动分页”:如果需要指定分页位置,请在 HTML 中插入分页标记
|