feat: Add key bindings for uppercase letters for bold, italic and underline (#2478)
This way, key bindings 'Mod-B', 'Mod-I' and 'Mod-U' with active caps lock have the same effect as their lowercase siblings. Prosemirror examples did the same, see ProseMirror/prosemirror#895 Fixes: #2426 Signed-off-by: Jonas <jonas@freesources.org>
This commit is contained in:
@@ -79,6 +79,7 @@ export const Bold = Mark.create<BoldOptions>({
|
|||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-b': () => this.editor.commands.toggleBold(),
|
'Mod-b': () => this.editor.commands.toggleBold(),
|
||||||
|
'Mod-B': () => this.editor.commands.toggleBold(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export const Italic = Mark.create<ItalicOptions>({
|
|||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-i': () => this.editor.commands.toggleItalic(),
|
'Mod-i': () => this.editor.commands.toggleItalic(),
|
||||||
|
'Mod-I': () => this.editor.commands.toggleItalic(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export const Underline = Mark.create<UnderlineOptions>({
|
|||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-u': () => this.editor.commands.toggleUnderline(),
|
'Mod-u': () => this.editor.commands.toggleUnderline(),
|
||||||
|
'Mod-U': () => this.editor.commands.toggleUnderline(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user