@ones-editor/editor 2.9.4 → 2.9.6
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
CHANGED
|
@@ -75767,7 +75767,14 @@ ${codeText}
|
|
|
75767
75767
|
...options,
|
|
75768
75768
|
listLevel: options.listLevel + 1
|
|
75769
75769
|
};
|
|
75770
|
-
|
|
75770
|
+
let heading;
|
|
75771
|
+
let tokens = item.tokens;
|
|
75772
|
+
if (item.tokens.length === 1 && item.tokens[0].type === "heading") {
|
|
75773
|
+
const token2 = item.tokens[0];
|
|
75774
|
+
heading = token2.depth;
|
|
75775
|
+
tokens = token2.tokens;
|
|
75776
|
+
}
|
|
75777
|
+
const { text: text2, children } = options.tokensToTextWithChildren(tokens, newOptions);
|
|
75771
75778
|
let checkbox2;
|
|
75772
75779
|
if (typeof item.checked === "boolean") {
|
|
75773
75780
|
checkbox2 = item.checked ? "checked" : "unchecked";
|
|
@@ -75782,6 +75789,9 @@ ${codeText}
|
|
|
75782
75789
|
text: text2,
|
|
75783
75790
|
level: options.listLevel
|
|
75784
75791
|
};
|
|
75792
|
+
if (heading) {
|
|
75793
|
+
block.heading = heading;
|
|
75794
|
+
}
|
|
75785
75795
|
blocks.push(block);
|
|
75786
75796
|
blocks.push(...children);
|
|
75787
75797
|
});
|
|
@@ -77694,6 +77704,9 @@ ${docStr}
|
|
|
77694
77704
|
function replaceCrLf(text2) {
|
|
77695
77705
|
return text2.replace(/\r\n\s*/g, "").replace(/\n\s*/g, "").replace(/\r\s*/g, "");
|
|
77696
77706
|
}
|
|
77707
|
+
function replaceCrLfWithSpace(text2) {
|
|
77708
|
+
return text2.replace(/\r\n\s*/g, " ").replace(/\n\s*/g, " ").replace(/\r\s*/g, " ");
|
|
77709
|
+
}
|
|
77697
77710
|
function isImageElement(elem) {
|
|
77698
77711
|
if (!elem.tagName) {
|
|
77699
77712
|
return false;
|
|
@@ -78064,7 +78077,7 @@ ${docStr}
|
|
|
78064
78077
|
}
|
|
78065
78078
|
const currentAttributes = addNodeAttributes(node, attributes);
|
|
78066
78079
|
if (node instanceof Text && node.nodeValue || node.nodeName === "BR") {
|
|
78067
|
-
const insert =
|
|
78080
|
+
const insert = replaceCrLfWithSpace((_a = node.nodeValue) != null ? _a : " ");
|
|
78068
78081
|
if (insert) {
|
|
78069
78082
|
ops.push(textNodeToOp(insert, currentAttributes));
|
|
78070
78083
|
}
|
|
@@ -94759,7 +94772,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
94759
94772
|
}
|
|
94760
94773
|
}
|
|
94761
94774
|
});
|
|
94762
|
-
editor.version = "2.9.
|
|
94775
|
+
editor.version = "2.9.6";
|
|
94763
94776
|
return editor;
|
|
94764
94777
|
}
|
|
94765
94778
|
function isDoc(doc2) {
|
|
@@ -94873,7 +94886,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
94873
94886
|
}
|
|
94874
94887
|
});
|
|
94875
94888
|
OnesEditorToolbar.register(editor);
|
|
94876
|
-
editor.version = "2.9.
|
|
94889
|
+
editor.version = "2.9.6";
|
|
94877
94890
|
return editor;
|
|
94878
94891
|
}
|
|
94879
94892
|
async function showDocVersions(editor, options, serverUrl) {
|