mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
feat: support some keyboard shortcuts (#100)
- `Ctrl-B` - `Ctrl-D` - `Ctrl-I`
This commit is contained in:
parent
c4235ad505
commit
650ceb439f
@ -100,6 +100,18 @@ const mutations = {
|
||||
editor.setValue(doc);
|
||||
},
|
||||
"Ctrl-S": function save(editor) {},
|
||||
"Ctrl-B": function bold(editor) {
|
||||
const selected = editor.getSelection();
|
||||
editor.replaceSelection(`**${selected}**`);
|
||||
},
|
||||
"Ctrl-D": function del(editor) {
|
||||
const selected = editor.getSelection();
|
||||
editor.replaceSelection(`~~${selected}~~`);
|
||||
},
|
||||
"Ctrl-I": function italic(editor) {
|
||||
const selected = editor.getSelection();
|
||||
editor.replaceSelection(`*${selected}*`);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user