This commit is contained in:
Vanessa 2022-06-10 16:35:08 +08:00
parent 4db338c1b0
commit d5c2093426
2 changed files with 5 additions and 3 deletions

View file

@ -1033,12 +1033,14 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
}
});
}
if (!hasNone || (hasNone && !hasRowSpan && hasColSpan) || colIsPure) {
if ((cellElement.parentElement.parentElement.tagName !== "THEAD" &&
((!hasNone && !hasRowSpan) || (hasNone && !hasRowSpan && hasColSpan))) || colIsPure) {
menus.push({
type: "separator"
});
}
if ((!hasNone && !hasRowSpan) || (hasNone && !hasRowSpan && hasColSpan)) {
if (cellElement.parentElement.parentElement.tagName !== "THEAD" &&
((!hasNone && !hasRowSpan) || (hasNone && !hasRowSpan && hasColSpan))) {
menus.push({
icon: "iconDeleteRow",
label: window.siyuan.languages["delete-row"],

View file

@ -148,7 +148,7 @@ export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElemen
};
export const deleteRow = (protyle: IProtyle, range: Range, cellElement: HTMLElement, nodeElement: Element) => {
if (cellElement.tagName === "TD") {
if (cellElement.parentElement.parentElement.tagName !== "THEAD") {
range.insertNode(document.createElement("wbr"));
const html = nodeElement.outerHTML;