From d8b1149797b3ad05eb96349960c8ec563378e1c7 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Wed, 6 Feb 2019 16:37:45 +0100 Subject: [PATCH] Make it possible to remove link --- components/Editor/Editor.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/Editor/Editor.vue b/components/Editor/Editor.vue index d99bade94..b59ca376d 100644 --- a/components/Editor/Editor.vue +++ b/components/Editor/Editor.vue @@ -257,11 +257,15 @@ export default { setLinkUrl(command, url) { const links = linkify().match(url) if (links) { + // add valid link command({ href: links.pop().url }) this.hideLinkMenu() this.editor.focus() + } else if (!url) { + // remove link + command({ href: null }) } } }