Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/7631

Vanessa002b5adf163e
diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts
index 00c218300e..7a1bcf101c 100644
--- a/app/src/protyle/util/table.ts
+++ b/app/src/protyle/util/table.ts
@@ -76,7 +76,7 @@ export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElem
let rowHTML = "";
for (let m = 0; m < cellElement.parentElement.childElementCount; m++) {
- rowHTML += `<td align="${cellElement.parentElement.children[m].getAttribute("align") || ""}"> </td>`;
+ rowHTML += `<td align="${cellElement.parentElement.children[m].getAttribute("align") || ""}"></td>`;
}
let newRowElememt: HTMLTableRowElement;
if (cellElement.tagName === "TH") {
@@ -113,10 +113,11 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTM
if (className === "fn__none") {
hasNone = true;
}
+ // 不需要空格,否则列宽调整后在空格后插入图片会换行 https://github.com/siyuan-note/siyuan/issues/7631
if (cellElement.tagName === "TH") {
- rowHTML += `<th class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"> </th>`;
+ rowHTML += `<th class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"></th>`;
} else {
- rowHTML += `<td class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"> </td>`;
+ rowHTML += `<td class="${currentCellElement.className}" colspan="${currentCellElement.colSpan}" align="${currentCellElement.getAttribute("align")}"></td>`;
}
}