Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/5153

Vanessad5c20934266d
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 7957808790..8731ae6bc2 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -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"],
diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts
index e7a53b6c2a..d71b1daca0 100644
--- a/app/src/protyle/util/table.ts
+++ b/app/src/protyle/util/table.ts
@@ -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;