Skip to content

Commit

Permalink
Cleanup linkifyjs when the editor is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
educastellano committed Oct 17, 2022
1 parent c729810 commit 07046a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/extension-link/src/link.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Mark, markPasteRule, mergeAttributes } from '@tiptap/core'
import { find, registerCustomProtocol } from 'linkifyjs'
import { find, registerCustomProtocol, reset } from 'linkifyjs'
import { Plugin } from 'prosemirror-state'

import { autolink } from './helpers/autolink'
Expand Down Expand Up @@ -65,6 +65,10 @@ export const Link = Mark.create<LinkOptions>({
this.options.protocols.forEach(registerCustomProtocol)
},

onDestroy() {
reset()
},

inclusive() {
return this.options.autolink
},
Expand Down

0 comments on commit 07046a6

Please sign in to comment.