From 23ee2027a0d51f6e5dd780998ea1ff45f86c4a65 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 25 Nov 2024 23:01:36 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13244 --- app/src/protyle/wysiwyg/index.ts | 2 +- app/src/protyle/wysiwyg/keydown.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 9b40ce40409..153932fef96 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2083,7 +2083,7 @@ export class WYSIWYG { if ( event.key !== "PageUp" && event.key !== "PageDown" && event.key !== "Home" && event.key !== "End" && event.key.indexOf("Arrow") === -1 && event.key !== "Escape" && event.key !== "Shift" && event.key !== "Meta" && event.key !== "Alt" && event.key !== "Control" && event.key !== "CapsLock" && - !event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey&& + !event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey && !/^F\d{1,2}$/.test(event.key) ){ // 搜狗输入法不走 keydown,需重新记录历史状态 if ( nodeElement && diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index f12df07cdc0..c6b15fa4f79 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -166,7 +166,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { // 有可能输入 shift+. ,因此需要使用 event.key 来进行判断 if (event.key !== "PageUp" && event.key !== "PageDown" && event.key !== "Home" && event.key !== "End" && event.key.indexOf("Arrow") === -1 && event.key !== "Escape" && event.key !== "Shift" && event.key !== "Meta" && event.key !== "Alt" && event.key !== "Control" && event.key !== "CapsLock" && - !isNotEditBlock(nodeElement) && !event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey&&!/^F\d{1,2}$/.test(event.key)) { + !isNotEditBlock(nodeElement) &&!/^F\d{1,2}$/.test(event.key)) { const cloneRange = range.cloneRange(); range.collapse(false); range.insertNode(document.createElement("wbr"));