docx-diff-editor 1.0.56 → 1.0.57
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 +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1110,17 +1110,31 @@ function getMarksAtPosition(spans, pos) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
return [];
|
|
1112
1112
|
}
|
|
1113
|
+
var INHERENT_FORMAT_MARKS = /* @__PURE__ */ new Set([
|
|
1114
|
+
"bold",
|
|
1115
|
+
"italic",
|
|
1116
|
+
"strike",
|
|
1117
|
+
"underline",
|
|
1118
|
+
"code",
|
|
1119
|
+
"subscript",
|
|
1120
|
+
"superscript"
|
|
1121
|
+
]);
|
|
1113
1122
|
function hasDefinedAttributes(marks) {
|
|
1114
1123
|
if (!marks || marks.length === 0) return false;
|
|
1115
1124
|
for (const mark of marks) {
|
|
1116
|
-
if (
|
|
1125
|
+
if (INHERENT_FORMAT_MARKS.has(mark.type)) {
|
|
1126
|
+
return true;
|
|
1127
|
+
}
|
|
1128
|
+
if (!mark.attrs) {
|
|
1129
|
+
return true;
|
|
1130
|
+
}
|
|
1117
1131
|
for (const value of Object.values(mark.attrs)) {
|
|
1118
|
-
if (value !== void 0 && value !== null) {
|
|
1132
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
1119
1133
|
return true;
|
|
1120
1134
|
}
|
|
1121
1135
|
}
|
|
1122
1136
|
}
|
|
1123
|
-
return
|
|
1137
|
+
return false;
|
|
1124
1138
|
}
|
|
1125
1139
|
function detectFormatChanges(spansA, spansB, segments) {
|
|
1126
1140
|
const formatChanges = [];
|