Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/12300

Vanessa0d4f9528cc69
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 03c08a80c3..54c54e56b1 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -600,9 +600,12 @@ export class Toolbar {
for (let i = 0; i < newNodes.length; i++) {
const currentNewNode = newNodes[i] as HTMLElement;
const nextNewNode = newNodes[i + 1] as HTMLElement;
+ const currentType = currentNewNode.getAttribute("data-type") || "";
if (currentNewNode.nodeType !== 3 && nextNewNode && nextNewNode.nodeType !== 3 &&
nextNewNode.tagName === currentNewNode.tagName &&
- isArrayEqual((nextNewNode.getAttribute("data-type") || "").split(" "), (currentNewNode.getAttribute("data-type") || "").split(" ")) &&
+ // 表格内多个换行 https://github.com/siyuan-note/siyuan/issues/12300
+ currentNewNode.tagName !== "BR" &&
+ isArrayEqual((nextNewNode.getAttribute("data-type") || "").split(" "), currentType.split(" ")) &&
currentNewNode.getAttribute("data-id") === nextNewNode.getAttribute("data-id") &&
currentNewNode.getAttribute("data-subtype") === nextNewNode.getAttribute("data-subtype") &&
currentNewNode.style.color === nextNewNode.style.color &&
@@ -612,7 +615,6 @@ export class Toolbar {
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
// 合并相同的 node
- const currentType = currentNewNode.getAttribute("data-type");
if (currentType.indexOf("inline-math") > -1) {
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));