check for simple space only
This commit is contained in:
@@ -29,9 +29,7 @@ export const Mention = Node.create<MentionOptions>({
|
|||||||
// increase range.to by one when the next node is of type "text"
|
// increase range.to by one when the next node is of type "text"
|
||||||
// and starts with a space character
|
// and starts with a space character
|
||||||
const nodeAfter = editor.view.state.selection.$to.nodeAfter
|
const nodeAfter = editor.view.state.selection.$to.nodeAfter
|
||||||
const overrideSpace = nodeAfter?.text
|
const overrideSpace = nodeAfter?.text?.startsWith(' ')
|
||||||
? /^\s/.test(nodeAfter.text)
|
|
||||||
: false
|
|
||||||
|
|
||||||
if (overrideSpace) {
|
if (overrideSpace) {
|
||||||
range.to += 1
|
range.to += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user