Make it possible to remove link

This commit is contained in:
Grzegorz Leoniec 2019-02-06 16:37:45 +01:00
parent 89d736d4a1
commit d8b1149797
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -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 })
}
}
}