Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/15226

Vanessa1d8c020aa7cf
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index e46b611ff9..3ef5d356e3 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -910,7 +910,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
// 需使用 textContent,文本元素没有 innerText
currentNode.textContent === "") // https://ld246.com/article/1649251218696
)) {
- removeBlock(protyle, nodeElement, range, "Backspace");
+ if (!nodeElement.classList.contains("code-block")) {
+ removeBlock(protyle, nodeElement, range, "Backspace");
+ }
event.stopPropagation();
event.preventDefault();
return;