diff --git a/packages/tiptap-extensions/src/plugins/Suggestions.js b/packages/tiptap-extensions/src/plugins/Suggestions.js index a8221013..e19b7e30 100644 --- a/packages/tiptap-extensions/src/plugins/Suggestions.js +++ b/packages/tiptap-extensions/src/plugins/Suggestions.js @@ -13,8 +13,8 @@ function triggerCharacter({ const suffix = new RegExp(`\\s${char}$`) const prefix = startOfLine ? '^' : '' const regexp = allowSpaces - ? new RegExp(`${prefix}${char}.*?(?=\\s${char}|$)`, 'g') - : new RegExp(`${prefix}(?:^)?${char}[^\\s${char}]*`, 'g') + ? new RegExp(`${prefix}${char}.*?(?=\\s${char}|$)`, 'gm') + : new RegExp(`${prefix}(?:^)?${char}[^\\s${char}]*`, 'gm') // Lookup the boundaries of the current node const textFrom = $position.before()