Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/8825

Vanessa2b0eb3d01bd3
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index d31c63179c..37f283c6f9 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) {