From 6402f0bfcfe283e389f10cc7c3e62884dbac9710 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 7 Oct 2023 21:11:50 -0400 Subject: [PATCH] fix: Enable backtick inline code shortcut on keyboard layouts that use composition for character Add Cmd+e shortcut to toggle inline code on macOS closes #5955 --- shared/editor/marks/Code.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/editor/marks/Code.ts b/shared/editor/marks/Code.ts index 7f0011ce9..7a3782d23 100644 --- a/shared/editor/marks/Code.ts +++ b/shared/editor/marks/Code.ts @@ -48,14 +48,15 @@ export default class Code extends Mark { } inputRules({ type }: { type: MarkType }) { - return [markInputRule(/(?:^|[^`])(`([^`]+)`)$/, type)]; + return [markInputRule(/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/, type)]; } keys({ type }: { type: MarkType }) { - // Note: This key binding only works on non-Mac platforms - // https://github.com/ProseMirror/prosemirror/issues/515 return { + // Note: This key binding only works on non-Mac platforms + // https://github.com/ProseMirror/prosemirror/issues/515 "Mod`": toggleMark(type), + "Mod-e": toggleMark(type), }; }