diff --git a/app/src/protyle/toolbar/InlineMemo.ts b/app/src/protyle/toolbar/InlineMemo.ts index 676448345..b5969e34b 100644 --- a/app/src/protyle/toolbar/InlineMemo.ts +++ b/app/src/protyle/toolbar/InlineMemo.ts @@ -16,7 +16,8 @@ export class InlineMemo extends ToolbarItem { return; } const memoElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-memo"); - if (memoElement) { + if (memoElement && memoElement.textContent === range.toString()) { + // https://github.com/siyuan-note/siyuan/issues/6569 protyle.toolbar.showRender(protyle, memoElement); return; } diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 8d92a3d20..b4d3fcb11 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -544,12 +544,18 @@ export class Toolbar { currentNewNode.style.fontSize === nextNewNode.style.fontSize && currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) { // 合并相同的 node - if (currentNewNode.getAttribute("data-type").indexOf("inline-math") > -1) { + 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")); - } else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) { - // 引用不虚合并内容 https://ld246.com/article/1664454663564 + } else if (currentType.indexOf("block-ref") === -1) { + // 引用不需合并内容 https://ld246.com/article/1664454663564 nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML; + // 如果为备注时,合并备注内容 + if (currentType.indexOf("inline-memo") > -1) { + nextNewNode.setAttribute("data-inline-memo-content", (currentNewNode.getAttribute("data-inline-memo-content") || "") + + (nextNewNode.getAttribute("data-inline-memo-content") || "")); + } } newNodes.splice(i, 1); i--;