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

Vanessa27d36e776bad
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index aec24a03e5..789203ea4c 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1003,12 +1003,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if (matchHotKey(window.siyuan.config.keymap.editor.general.quickMakeCard.custom, event)) {
const selectElement: Element[] = [];
- if (!hasClosestByClassName(nodeElement, "protyle-wysiwyg--select")) {
- nodeElement.classList.add("protyle-wysiwyg--select");
- }
protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select").forEach(item => {
selectElement.push(item);
});
+ if (selectElement.length === 0) {
+ selectElement.push(nodeElement)
+ }
quickMakeCard(selectElement);
event.preventDefault();
event.stopPropagation();