This commit is contained in:
Vanessa 2022-07-07 11:40:52 +08:00
parent d3636e328f
commit acddd46012
2 changed files with 4 additions and 2 deletions

View file

@ -37,7 +37,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
}, { }, {
filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"], filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"],
value: Constants.ZWSP + 4, 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: "", value: "",
html: "separator", html: "separator",

View file

@ -1,4 +1,4 @@
import {genEmptyElement} from "../../block/util"; import {genEmptyElement, insertEmptyBlock} from "../../block/util";
import {getSelectionOffset, focusByWbr} from "../util/selection"; import {getSelectionOffset, focusByWbr} from "../util/selection";
import { import {
getContenteditableElement, getContenteditableElement,
@ -188,6 +188,8 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
if (isNotEditBlock(blockElement)) { if (isNotEditBlock(blockElement)) {
if (blockElement.classList.contains("render-node")) { if (blockElement.classList.contains("render-node")) {
protyle.toolbar.showRender(protyle, blockElement); protyle.toolbar.showRender(protyle, blockElement);
} else if (blockElement.classList.contains("hr")) {
insertEmptyBlock(protyle, "afterend");
} else { } else {
protyle.gutter.renderMenu(protyle, blockElement); protyle.gutter.renderMenu(protyle, blockElement);
window.siyuan.menus.menu.element.classList.remove("fn__none"); window.siyuan.menus.menu.element.classList.remove("fn__none");