diff --git a/packages/text-editor/src/components/extension/emoji.ts b/packages/text-editor/src/components/extension/emoji.ts index 0cd8c5c474..a18c684141 100644 --- a/packages/text-editor/src/components/extension/emoji.ts +++ b/packages/text-editor/src/components/extension/emoji.ts @@ -67,7 +67,7 @@ export const EmojiExtension = Extension.create({ addInputRules () { return Object.keys(emojiReplaceDict).map((pattern) => { return { - find: new RegExp(`(?:^|\\s)(${escapeRegExp(pattern)})`), + find: new RegExp(`(?:^|\\s)(${escapeRegExp(pattern)})$`), handler: ({ state, range, match, commands }) => { const $from = state.doc.resolve(range.from) if (!isValidEmojiPosition($from)) {