diff --git a/packages/extension-link/src/link.ts b/packages/extension-link/src/link.ts index 9ca3e80cf..92b4f0f66 100644 --- a/packages/extension-link/src/link.ts +++ b/packages/extension-link/src/link.ts @@ -103,14 +103,15 @@ export const Link = Mark.create({ props: { handleClick: (view, pos, event) => { const attrs = this.editor.getMarkAttributes('link') + const link = (event.target as HTMLElement)?.closest('a') - if (attrs.href && event.target instanceof HTMLAnchorElement) { + if (link && attrs.href) { window.open(attrs.href, attrs.target) - return false + return true } - return true + return false }, }, }),