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

Vanessabe7ac739048b
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index e890050bb4..a99751625e 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -964,6 +964,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.preventDefault();
return;
}
+ // https://github.com/siyuan-note/siyuan/issues/15424
+ if (position.start === 1 && rangeNextElement && rangeNextElement.nodeType === 1 &&
+ rangeNextElement.dataset.type === "code") {
+ range.insertNode(document.createTextNode(Constants.ZWSP));
+ range.collapse(true);
+ }
}
// 代码块中空行 ⌘+Del 异常 https://ld246.com/article/1663166544901
if (nodeElement.classList.contains("code-block") && isOnlyMeta(event) &&