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/8925

Vanessa67f56144571c
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 7e81a084cf..7c9accdbfd 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -247,17 +247,17 @@ export class WYSIWYG {
}
} else {
selectElements.forEach((item, index) => {
- const topElement = getTopAloneElement(item);
+ // 复制列表项中的块会变为复制列表项,因此不能使用 getTopAloneElement https://github.com/siyuan-note/siyuan/issues/8925
if (isRefText && index === 0) {
- const cloneElement = topElement.cloneNode(true) as HTMLElement;
+ const cloneElement = item.cloneNode(true) as HTMLElement;
const cloneEditElement = getContenteditableElement(cloneElement);
if (cloneEditElement) {
- cloneEditElement.insertAdjacentHTML("beforeend", ` <span data-type="block-ref" data-subtype="s" data-id="${topElement.getAttribute("data-node-id")}">*</span>`);
+ cloneEditElement.insertAdjacentHTML("beforeend", ` <span data-type="block-ref" data-subtype="s" data-id="${item.getAttribute("data-node-id")}">*</span>`);
}
html += removeEmbed(cloneElement);
selectElements[0].removeAttribute("data-reftext");
} else {
- html += removeEmbed(topElement);
+ html += removeEmbed(item);
}
});
}