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

Vanessa3feea1c7a7d2
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index abcfc8b38d..2492518b42 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -914,7 +914,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
currentNode.textContent === "") // https://ld246.com/article/1649251218696
)) {
if (!nodeElement.classList.contains("code-block") ||
- (nodeElement.classList.contains("code-block") && editElement.textContent == "\n")
+ (nodeElement.classList.contains("code-block") &&
+ (editElement.textContent == "\n" || nodeElement.parentElement.classList.contains("li")))
) {
removeBlock(protyle, nodeElement, range, "Backspace");
}