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/6764

Vanessadf9b6dc4d5ea
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index a1ee8e9d4f..e3a580a89d 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -1022,9 +1022,10 @@ export class Toolbar {
// 需 div 包裹,否则行内元素会解析错误 https://github.com/siyuan-note/siyuan/issues/6764
let html = textElement.value;
if (!html.startsWith("<div>\n")) {
- html = `<div>
-${html}
-</div>`;
+ html = `<div>\n${html}`;
+ }
+ if (!html.startsWith("\n</div>")) {
+ html = `${html}\n</div>`;
}
renderElement.querySelector("protyle-html").setAttribute("data-content", Lute.EscapeHTMLStr(html));
} else if (isInlineMemo) {