@docen/import-docx 0.0.14 → 0.0.15
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/dist/index.mjs +10 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1241,6 +1241,16 @@ async function convertParagraph(node, params) {
|
|
|
1241
1241
|
const { context, styleInfo: paramStyleInfo } = params;
|
|
1242
1242
|
const pPr = findChild(node, "w:pPr");
|
|
1243
1243
|
const styleName = (pPr && findChild(pPr, "w:pStyle"))?.attributes["w:val"];
|
|
1244
|
+
if (pPr) {
|
|
1245
|
+
const outlineLvlElement = findChild(pPr, "w:outlineLvl");
|
|
1246
|
+
if (outlineLvlElement?.attributes["w:val"] !== void 0) {
|
|
1247
|
+
const outlineLvl = parseInt(outlineLvlElement.attributes["w:val"], 10);
|
|
1248
|
+
if (outlineLvl >= 0 && outlineLvl <= 5) {
|
|
1249
|
+
const level = outlineLvl + 1;
|
|
1250
|
+
return convertHeading(node, params, styleName && context.styleMap ? context.styleMap.get(styleName) : void 0, level);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1244
1254
|
if (styleName && context.styleMap) {
|
|
1245
1255
|
const styleInfo = context.styleMap.get(styleName);
|
|
1246
1256
|
if (styleInfo?.outlineLvl !== void 0 && styleInfo.outlineLvl >= 0 && styleInfo.outlineLvl <= 5) return convertHeading(node, params, styleInfo, styleInfo.outlineLvl + 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docen/import-docx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "A powerful TipTap/ProseMirror extension that imports Microsoft Word DOCX files to editor content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"converter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@tiptap/core": "3.20.4",
|
|
55
55
|
"@types/xast": "2.0.4",
|
|
56
|
-
"@docen/extensions": "0.0.
|
|
57
|
-
"@docen/utils": "0.0.
|
|
56
|
+
"@docen/extensions": "0.0.15",
|
|
57
|
+
"@docen/utils": "0.0.15"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@napi-rs/canvas": "^0.1.88"
|