Skip to content

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

:bug: 图片剪切问题 段落存在图片时,选中图片,使用快捷键进行剪切或复制会操作整个段落。

Vanessad31658590517
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index e592b99222..3e67899350 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1485,7 +1485,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
// 支持非编辑块复制 https://ld246.com/article/1695353747104
- if ((matchHotKey("⌘X", event) || matchHotKey("⌘C", event)) && selectText === "") {
+ if ((matchHotKey("⌘X", event) || matchHotKey("⌘C", event)) &&
+ selectText === "" &&
+ !nodeElement.querySelector(".img--select")) {
if (protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select").length === 0) {
if (nodeElement.dataset.type !== "NodeHTMLBlock") {
// html 块不需要选中 https://github.com/siyuan-note/siyuan/issues/8706