Skip to content

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

fix: 改进在反链面板中全选 (#13985)

Jeffrey Chen923b8c7e37fa
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index e03515e250..2b7600c6a9 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -114,8 +114,11 @@ export const selectAll = (protyle: IProtyle, nodeElement: Element, range: Range)
hideElements(["select"], protyle);
const ids: string [] = [];
Array.from(protyle.wysiwyg.element.children).forEach(item => {
- item.classList.add("protyle-wysiwyg--select");
- ids.push(item.getAttribute("data-node-id"));
+ const nodeId = item.getAttribute("data-node-id");
+ if (nodeId) {
+ item.classList.add("protyle-wysiwyg--select");
+ ids.push(nodeId);
+ }
});
countBlockWord(ids, protyle.block.rootID);
};