From 4fa3193b23b337d8538b3cc54ee9e68e5fc0ce4d Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 30 Nov 2017 13:00:15 -0500 Subject: [PATCH] fixed quote shortcut --- editor.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor.js b/editor.js index 5be7118..4bf0145 100644 --- a/editor.js +++ b/editor.js @@ -52,8 +52,11 @@ ";": (evnt) => keyCmd(evnt, "insertHTML", "\r\n"), "'": (evnt) => { - const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "

" : "

"); - return !document.execCommand("formatBlock", false, block); + if (evnt.ctrlKey || evnt.metaKey) { + const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "

" : "

"); + return !document.execCommand("formatBlock", false, block); + } + return true; }, }; @@ -64,7 +67,7 @@ return "" + date.getFullYear() + "." + (month > 9 ? '' : '0') + month + "." + - (day > 9 ? '' : '0') + day + (day > 9 ? '' : '0') + day; }; header.onkeyup = (evnt) => { -- 2.49.0