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

Vanessa4de3649673de
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 98f5db4531..969c56c4e2 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -736,14 +736,14 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
} else if (nodeEditableElement?.innerText.substr(position.end).indexOf("\n") === -1 || position.end >= nodeEditableElement.innerText.trimEnd().length) {
// 需使用 innerText,否则 td 中的 br 无法转换为 \n; position.end 不能加1,否则倒数第二行行末无法下移
range.collapse(false);
- const nextFoldElement = getNextBlock(nodeElement) as HTMLElement;
- if (nextFoldElement) {
- if(nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
- focusBlock(nextFoldElement);
- scrollCenter(protyle, nextFoldElement);
- event.stopPropagation();
- event.preventDefault();
- }
+ const nextElement = getNextBlock(nodeElement) as HTMLElement;
+ if (nextElement &&
+ (nextElement.getAttribute("fold") === "1" || nextElement.classList.contains("code-block")) &&
+ nodeEditableElement.getBoundingClientRect().bottom - getSelectionPosition(nodeElement, range).top < 40) {
+ focusBlock(nextElement);
+ scrollCenter(protyle, nextElement);
+ event.stopPropagation();
+ event.preventDefault();
}
}
}