Add Markdown editor keyboard shortcuts
What does this MR do?
Adds the ability to associate keyboard shortcuts with toolbar buttons in Markdown editors.
This MR implements three (hopefully) non-controversial shortcuts:
Action | Mac shortcut | Non-Mac shortcut |
---|---|---|
Bold | ⌘+B | Ctrl+B |
Italic | ⌘+I | Ctrl+I |
link | ⌘+K | Ctrl+K |
This MR partially completes #17181
GIF
Screenshots
Toolbar button tooltips now include the shortcut:
On non-Mac platforms, the tooltips read Ctrl+B instead of ⌘+B.
Update: Mac shortcut tooltips no longer have the +
(for example, ⌘B
). See !40328 (comment 408531767).
Testing locally
We have two implementations of our Markdown editors: one built with Vue, and one with Haml. It's important to test both of these implementation when testing locally. The Vue version can be tested on the New Release page (https://gitlab.example.com/user/project/-/releases/new
); the Haml version can be tested on the New Snippet page (https://gitlab.example.com/-/snippets/new
).