docx-diff-editor 1.0.59 → 1.0.60
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.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -970,6 +970,30 @@ async function parseHtmlToJson(html, SuperDoc) {
|
|
|
970
970
|
}, 50);
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
|
+
function syncNumberingToParent(childEditor, parentEditor) {
|
|
974
|
+
try {
|
|
975
|
+
const childNumbering = childEditor?.converter?.numbering;
|
|
976
|
+
const parentNumbering = parentEditor?.converter?.numbering;
|
|
977
|
+
if (!childNumbering || !parentNumbering) {
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
if (childNumbering.definitions) {
|
|
981
|
+
parentNumbering.definitions = {
|
|
982
|
+
...parentNumbering.definitions,
|
|
983
|
+
...childNumbering.definitions
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
if (childNumbering.abstracts) {
|
|
987
|
+
parentNumbering.abstracts = {
|
|
988
|
+
...parentNumbering.abstracts,
|
|
989
|
+
...childNumbering.abstracts
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
parentEditor.converter.numbering = parentNumbering;
|
|
993
|
+
} catch (err) {
|
|
994
|
+
console.warn("[syncNumberingToParent] Failed to sync numbering definitions:", err);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
973
997
|
async function parseHtmlWithLinkedEditor(html, mainEditor) {
|
|
974
998
|
const container = document.createElement("div");
|
|
975
999
|
container.style.cssText = "position:absolute;top:-9999px;left:-9999px;width:800px;height:600px;visibility:hidden;";
|
|
@@ -1000,6 +1024,7 @@ async function parseHtmlWithLinkedEditor(html, mainEditor) {
|
|
|
1000
1024
|
if (resolved) return;
|
|
1001
1025
|
try {
|
|
1002
1026
|
childEditor = localEditor;
|
|
1027
|
+
syncNumberingToParent(localEditor, mainEditor);
|
|
1003
1028
|
const json = localEditor.getJSON();
|
|
1004
1029
|
const normalizedJson = normalizeRunProperties(json);
|
|
1005
1030
|
resolved = true;
|