Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/5358

Vanessaacddd4601254
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts
index a1e105f144..26af5ffb4d 100644
--- a/app/src/protyle/hint/extend.ts
+++ b/app/src/protyle/hint/extend.ts
@@ -37,7 +37,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
}, {
filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"],
value: Constants.ZWSP + 4,
- html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconFile"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.newFile}</span></div>`,
+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconFile"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.newFile}</span><span class="b3-menu__accelerator">${updateHotkeyTip(window.siyuan.config.keymap.general.newFile.custom)}</span></div>`,
}, {
value: "",
html: "separator",
diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts
index 7ad86a9b8f..bbb3266cfa 100644
--- a/app/src/protyle/wysiwyg/enter.ts
+++ b/app/src/protyle/wysiwyg/enter.ts
@@ -1,4 +1,4 @@
-import {genEmptyElement} from "../../block/util";
+import {genEmptyElement, insertEmptyBlock} from "../../block/util";
import {getSelectionOffset, focusByWbr} from "../util/selection";
import {
getContenteditableElement,
@@ -188,6 +188,8 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
if (isNotEditBlock(blockElement)) {
if (blockElement.classList.contains("render-node")) {
protyle.toolbar.showRender(protyle, blockElement);
+ } else if (blockElement.classList.contains("hr")) {
+ insertEmptyBlock(protyle, "afterend");
} else {
protyle.gutter.renderMenu(protyle, blockElement);
window.siyuan.menus.menu.element.classList.remove("fn__none");