From 53b1d0d4dfa1635b99ac6dd3f2d7febffe231f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 21 May 2019 00:11:26 +0200 Subject: [PATCH] fix bug in suggestions plugin, fix #176 --- packages/tiptap-extensions/src/plugins/Suggestions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/tiptap-extensions/src/plugins/Suggestions.js b/packages/tiptap-extensions/src/plugins/Suggestions.js index 63b40ba36..8cebbcbf2 100644 --- a/packages/tiptap-extensions/src/plugins/Suggestions.js +++ b/packages/tiptap-extensions/src/plugins/Suggestions.js @@ -10,6 +10,11 @@ function triggerCharacter({ }) { return $position => { + // cancel if top level node + if ($position.depth <= 0) { + return false + } + // Matching expressions used for later const escapedChar = `\\${char}` const suffix = new RegExp(`\\s${escapedChar}$`)