From b7d22bf0dc8531a8927a9da0f50b675e0630ff8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 20 Aug 2021 21:02:54 +0200 Subject: [PATCH] check for simple space only --- packages/extension-mention/src/mention.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/extension-mention/src/mention.ts b/packages/extension-mention/src/mention.ts index 75dd7d9f..61608d23 100644 --- a/packages/extension-mention/src/mention.ts +++ b/packages/extension-mention/src/mention.ts @@ -29,9 +29,7 @@ export const Mention = Node.create({ // increase range.to by one when the next node is of type "text" // and starts with a space character const nodeAfter = editor.view.state.selection.$to.nodeAfter - const overrideSpace = nodeAfter?.text - ? /^\s/.test(nodeAfter.text) - : false + const overrideSpace = nodeAfter?.text?.startsWith(' ') if (overrideSpace) { range.to += 1