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
This commit is contained in:
Tom Moor
2023-10-07 21:11:50 -04:00
parent 2f3247b500
commit 6402f0bfcf

View File

@@ -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),
};
}