Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/9349

Vanessa90432f818aee
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 674b0aa39a..29b3fc5dda 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1483,18 +1483,17 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
if (matchHotKey("⌘X", event) && selectText === "") {
+ const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
+ if (selectElements.length === 0) {
+ nodeElement.classList.add("protyle-wysiwyg--select");
+ selectElements.push(nodeElement);
+ }
let html = "";
- nodeElement.classList.add("protyle-wysiwyg--select");
- const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
selectElements.forEach(item => {
html += removeEmbed(item);
});
writeText(protyle.lute.BlockDOM2StdMd(html).trimEnd());
- const nextElement = getNextBlock(selectElements[selectElements.length - 1]);
removeBlock(protyle, nodeElement, range);
- if (nextElement) {
- focusBlock(nextElement);
- }
event.preventDefault();
event.stopPropagation();
}