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

Vanessa76ef70ae68a1
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 2554eeb457..3059869c57 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -527,7 +527,11 @@ export class Toolbar {
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
// 合并相同的 node
- if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) { // 引用不虚合并内容 https://ld246.com/article/1664454663564
+ if (currentNewNode.getAttribute("data-type").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"))
+ } else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) {
+ // 引用不虚合并内容 https://ld246.com/article/1664454663564
nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML;
}
newNodes.splice(i, 1);