From 76d0597e9705081cc1010e940311c1837fe26d44 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 30 Sep 2017 20:53:17 -0700 Subject: [PATCH] Add cmd+k to insert link --- frontend/components/Editor/plugins/KeyboardShortcuts.js | 5 +++++ frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/frontend/components/Editor/plugins/KeyboardShortcuts.js b/frontend/components/Editor/plugins/KeyboardShortcuts.js index e9e15065..fb1f448c 100644 --- a/frontend/components/Editor/plugins/KeyboardShortcuts.js +++ b/frontend/components/Editor/plugins/KeyboardShortcuts.js @@ -22,6 +22,11 @@ export default function KeyboardShortcuts() { return this.toggleMark(state, 'underlined'); case 'd': return this.toggleMark(state, 'deleted'); + case 'k': + return state + .transform() + .wrapInline({ type: 'link', data: { href: '' } }) + .apply(); default: return null; } diff --git a/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js b/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js index 037b05a1..bbae9e86 100644 --- a/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js +++ b/frontend/scenes/KeyboardShortcuts/KeyboardShortcuts.js @@ -48,6 +48,10 @@ function KeyboardShortcuts() { Cmd + u + Cmd + d + + Cmd + k + Cmd + z Cmd + Shift + z