From 2b0eb3d01bd374a0c78f111604f5fddc08ac300c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 26 Jul 2023 18:42:16 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8825 --- app/src/protyle/toolbar/index.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index d31c63179..37f283c6f 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -453,13 +453,12 @@ export class Toolbar { setFontStyle(inlineElement, textObj); newNodes.push(inlineElement); } else { - // https://github.com/siyuan-note/siyuan/issues/7477 + // https://github.com/siyuan-note/siyuan/issues/7477 + // https://github.com/siyuan-note/siyuan/issues/8825 if (type === "block-ref") { - contents.childNodes.forEach((item: HTMLElement, index) => { - if (index !== 0) { - item.remove(); - } - }); + while (contents.childNodes.length > 1) { + contents.childNodes[0].remove(); + } } contents.childNodes.forEach((item: HTMLElement, index) => { if (item.nodeType === 3) {