mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 22:36:14 +08:00
Cleanup linkifyjs when the editor is destroyed (#3316)
This commit is contained in:
parent
a966059dc0
commit
1c493f3593
@ -1,5 +1,5 @@
|
|||||||
import { Mark, markPasteRule, mergeAttributes } from '@tiptap/core'
|
import { Mark, markPasteRule, mergeAttributes } from '@tiptap/core'
|
||||||
import { find, registerCustomProtocol } from 'linkifyjs'
|
import { find, registerCustomProtocol, reset } from 'linkifyjs'
|
||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
|
|
||||||
import { autolink } from './helpers/autolink'
|
import { autolink } from './helpers/autolink'
|
||||||
@ -65,6 +65,10 @@ export const Link = Mark.create<LinkOptions>({
|
|||||||
this.options.protocols.forEach(registerCustomProtocol)
|
this.options.protocols.forEach(registerCustomProtocol)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
reset()
|
||||||
|
},
|
||||||
|
|
||||||
inclusive() {
|
inclusive() {
|
||||||
return this.options.autolink
|
return this.options.autolink
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user