feat: add extendEmptyMarkRange option to mark commands (#1859)

This commit is contained in:
Philipp Kühn
2021-09-08 09:32:22 +02:00
committed by GitHub
parent b95507797d
commit 14e458ea7d
3 changed files with 42 additions and 21 deletions

View File

@@ -92,10 +92,10 @@ export const Link = Mark.create<LinkOptions>({
return commands.setMark('link', attributes)
},
toggleLink: attributes => ({ commands }) => {
return commands.toggleMark('link', attributes)
return commands.toggleMark('link', attributes, { extendEmptyMarkRange: true })
},
unsetLink: () => ({ commands }) => {
return commands.unsetMark('link')
return commands.unsetMark('link', { extendEmptyMarkRange: true })
},
}
},