fix: fixes an error when using the mention extension and pasting text ending with "@", fix #2413

This commit is contained in:
Philipp Kühn
2022-01-21 09:29:36 +01:00
parent 878dd5ced7
commit 55fa220899
2 changed files with 7 additions and 6 deletions

View File

@@ -51,9 +51,9 @@ export const Mention = Node.create<MentionOptions>({
])
.run()
},
allow: ({ editor, range }) => {
const $from = editor.state.doc.resolve(range.from)
const type = editor.schema.nodes[this.name]
allow: ({ state, range }) => {
const $from = state.doc.resolve(range.from)
const type = state.schema.nodes[this.name]
const allow = !!$from.parent.type.contentMatch.matchType(type)
return allow