]> git.mdlowis.com Git - proto/journal.git/commitdiff
fixed quote shortcut
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 30 Nov 2017 18:00:15 +0000 (13:00 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 30 Nov 2017 18:00:15 +0000 (13:00 -0500)
editor.js

index 5be7118550a7bf2d904acf35bb91d91e55b671ba..4bf01452b1ec84678041681e8f1b90130f3a4d61 100644 (file)
--- a/editor.js
+++ b/editor.js
 
         ";": (evnt) => keyCmd(evnt, "insertHTML", "<code>\r\n</code>"),
         "'": (evnt) => {
-            const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "<p>" : "<blockquote>");
-            return !document.execCommand("formatBlock", false, block);
+            if (evnt.ctrlKey || evnt.metaKey) {
+                const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "<p>" : "<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) => {