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/insider/issues/1074

Vanessa78f79af636d5
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 4626fbb69e..c4adf5a152 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -758,7 +758,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return;
}
// 代码块中空行 ⌘+Del 异常 https://ld246.com/article/1663166544901
- if (nodeElement.classList.contains("code-block") && range.startContainer.nodeType === 3 && range.startContainer.textContent.substring(range.startOffset - 1, range.startOffset) === "\n") {
+ if (nodeElement.classList.contains("code-block") && isCtrl(event) &&
+ range.startContainer.nodeType === 3 && range.startContainer.textContent.substring(range.startOffset - 1, range.startOffset) === "\n") {
event.stopPropagation();
event.preventDefault();
return;