@kaitify/core 0.0.2-beta.10 → 0.0.2-beta.12
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/lib/kaitify-core.es.js +13 -5
- package/lib/kaitify-core.umd.js +1 -1
- package/package.json +1 -1
package/lib/kaitify-core.es.js
CHANGED
|
@@ -36046,6 +36046,11 @@ const TableExtension = () => Extension.create({
|
|
|
36046
36046
|
if (isHideCell(node)) {
|
|
36047
36047
|
node.void = true;
|
|
36048
36048
|
}
|
|
36049
|
+
if (!node.hasChildren()) {
|
|
36050
|
+
const placeholderNode = KNode.createPlaceholder();
|
|
36051
|
+
node.children = [placeholderNode];
|
|
36052
|
+
placeholderNode.parent = node;
|
|
36053
|
+
}
|
|
36049
36054
|
}
|
|
36050
36055
|
if (node.isMatch({ tag: "colgroup" })) {
|
|
36051
36056
|
node.type = "block";
|
|
@@ -36121,7 +36126,12 @@ const TableExtension = () => Extension.create({
|
|
|
36121
36126
|
const rows = nodes.filter((item) => item.isMatch({ tag: "tr" })).map((item) => {
|
|
36122
36127
|
item.parent = tbody;
|
|
36123
36128
|
if (item.hasChildren()) {
|
|
36124
|
-
item.children = item.children.
|
|
36129
|
+
item.children = item.children.map((it) => {
|
|
36130
|
+
if (!it.isMatch({ tag: "td" }) && !it.isMatch({ tag: "th" })) {
|
|
36131
|
+
it.toEmpty();
|
|
36132
|
+
}
|
|
36133
|
+
return it;
|
|
36134
|
+
});
|
|
36125
36135
|
}
|
|
36126
36136
|
return item;
|
|
36127
36137
|
});
|
|
@@ -37321,9 +37331,7 @@ class Editor {
|
|
|
37321
37331
|
const tag = dom.nodeName.toLocaleLowerCase();
|
|
37322
37332
|
const namespace = dom.namespaceURI;
|
|
37323
37333
|
if (this.emptyRenderTags.includes(tag)) {
|
|
37324
|
-
return KNode.
|
|
37325
|
-
type: "text"
|
|
37326
|
-
});
|
|
37334
|
+
return KNode.createZeroWidthText();
|
|
37327
37335
|
}
|
|
37328
37336
|
if (tag == this.textRenderTag && dom.childNodes.length && Array.from(dom.childNodes).every((childNode) => childNode.nodeType == 3)) {
|
|
37329
37337
|
return KNode.create({
|
|
@@ -38009,7 +38017,7 @@ class Editor {
|
|
|
38009
38017
|
} else {
|
|
38010
38018
|
this.delete();
|
|
38011
38019
|
}
|
|
38012
|
-
this.insertNode(node);
|
|
38020
|
+
this.insertNode(node, cover);
|
|
38013
38021
|
return;
|
|
38014
38022
|
}
|
|
38015
38023
|
const offset = this.selection.start.offset;
|