diff --git a/src/data/Thread.js b/src/data/Thread.js index 5b34a8b..75ebfc9 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -207,8 +207,9 @@ class Thread { }, {}); text = text.replace( - new RegExp(`${config.inlineSnippetStart}(.+?)${config.inlineSnippetEnd}`, "i"), + new RegExp(`${config.inlineSnippetStart}(\\s*\\S+?\\s*)${config.inlineSnippetEnd}`, "i"), (orig, trigger) => { + trigger = trigger.trim(); const snippet = snippetMap[trigger.toLowerCase()]; return snippet != null ? snippet.body : orig; }