diff --git a/public/scripts/slash-commands/SlashCommandParser.js b/public/scripts/slash-commands/SlashCommandParser.js index d7f32990c..0f3c6a85c 100644 --- a/public/scripts/slash-commands/SlashCommandParser.js +++ b/public/scripts/slash-commands/SlashCommandParser.js @@ -645,6 +645,7 @@ export class SlashCommandParser { closure.abortController = this.abortController; closure.debugController = this.debugController; this.scope = closure.scope; + const oldClosure = this.closure; this.closure = closure; this.discardWhitespace(); while (this.testNamedArgument()) { @@ -698,6 +699,7 @@ export class SlashCommandParser { } closureIndexEntry.end = this.index - 1; this.scope = closure.scope.parent; + this.closure = oldClosure ?? closure; return closure; }