A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)

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

Vanessa 5b8958d0 51fe9b1a

+11 -4
+2 -1
app/src/protyle/toolbar/InlineMemo.ts
··· 16 16 return; 17 17 } 18 18 const memoElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-memo"); 19 - if (memoElement) { 19 + if (memoElement && memoElement.textContent === range.toString()) { 20 + // https://github.com/siyuan-note/siyuan/issues/6569 20 21 protyle.toolbar.showRender(protyle, memoElement); 21 22 return; 22 23 }
+9 -3
app/src/protyle/toolbar/index.ts
··· 544 544 currentNewNode.style.fontSize === nextNewNode.style.fontSize && 545 545 currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) { 546 546 // 合并相同的 node 547 - if (currentNewNode.getAttribute("data-type").indexOf("inline-math") > -1) { 547 + const currentType = currentNewNode.getAttribute("data-type") 548 + if (currentType.indexOf("inline-math") > -1) { 548 549 // 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028 549 550 nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content")); 550 - } else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) { 551 - // 引用不虚合并内容 https://ld246.com/article/1664454663564 551 + } else if (currentType.indexOf("block-ref") === -1) { 552 + // 引用不需合并内容 https://ld246.com/article/1664454663564 552 553 nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML; 554 + // 如果为备注时,合并备注内容 555 + if (currentType.indexOf("inline-memo") > -1) { 556 + nextNewNode.setAttribute("data-inline-memo-content", (currentNewNode.getAttribute("data-inline-memo-content") || "") + 557 + (nextNewNode.getAttribute("data-inline-memo-content") || "")); 558 + } 553 559 } 554 560 newNodes.splice(i, 1); 555 561 i--;