From 6b51f9d778d1d11bc01876435ed49a689b3c4d8d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 6 Mar 2023 15:34:08 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/7548 --- app/src/protyle/toolbar/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index bef4b0997..2b9e34a6f 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -622,7 +622,12 @@ export class Toolbar { } } if (previousElement) { - this.mergeNode(previousElement.childNodes); + if (previousElement.nodeType !== 3 && previousElement.textContent === Constants.ZWSP) { + // https://github.com/siyuan-note/siyuan/issues/7548 + previousElement.remove(); + } else { + this.mergeNode(previousElement.childNodes); + } } if (nextElement) { this.mergeNode(nextElement.childNodes);