fix: fixes an error when using the mention extension and pasting text ending with "@", fix #2413
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user