docs: update link demo, fix #1564

This commit is contained in:
Hans Pagel 2021-07-10 23:56:29 +02:00
parent d466371d7e
commit 2ebed3054f
2 changed files with 7 additions and 2 deletions

View File

@ -53,7 +53,12 @@ export default {
setLink() {
const url = window.prompt('URL')
this.editor.chain().focus().setLink({ href: url }).run()
this.editor
.chain()
.focus()
.extendMarkRange('link')
.setLink({ href: url })
.run()
},
},

View File

@ -40,4 +40,4 @@ This extension doesnt bind a specific keyboard shortcut. You would probably o
[packages/extension-link/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-link/)
## Usage
<demo name="Marks/Link" highlight="3-8,19,38,55" />
<demo name="Marks/Link" highlight="3-8,18,39,56-61" />