Only consider single words as inline snippets
Optionally surrounded by whitespace. This mirrors the restrictions on !!snippets.cshd
parent
9a88a6ef89
commit
3e44416077
|
@ -207,8 +207,9 @@ class Thread {
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
text = text.replace(
|
text = text.replace(
|
||||||
new RegExp(`${config.inlineSnippetStart}(.+?)${config.inlineSnippetEnd}`, "i"),
|
new RegExp(`${config.inlineSnippetStart}(\\s*\\S+?\\s*)${config.inlineSnippetEnd}`, "i"),
|
||||||
(orig, trigger) => {
|
(orig, trigger) => {
|
||||||
|
trigger = trigger.trim();
|
||||||
const snippet = snippetMap[trigger.toLowerCase()];
|
const snippet = snippetMap[trigger.toLowerCase()];
|
||||||
return snippet != null ? snippet.body : orig;
|
return snippet != null ? snippet.body : orig;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue