From a51d9a1b1a7f355c83f17e00b1a5f02815d16a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sun, 30 Sep 2018 20:20:18 +0200 Subject: [PATCH] fix suggestions in safari browser --- packages/tiptap-extensions/src/plugins/Suggestions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()