diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 103e33857..b30f322f6 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -1565,6 +1565,19 @@ async function executeSlashCommands(text, unescape = false) { unnamedArg = unnamedArg.replace(/{{pipe}}/i, pipeResult ?? ''); } + unnamedArg = unnamedArg + ?.replace(/\\\|/g, '|') + ?.replace(/\\\{/g, '{') + ?.replace(/\\\}/g, '}') + ; + for (const [key, value] of Object.entries(result.args)) { + result.args[key] = value + .replace(/\\\|/g, '|') + .replace(/\\\{/g, '{') + .replace(/\\\}/g, '}') + ; + } + pipeResult = await result.command.callback(result.args, unnamedArg); if (result.command.interruptsGeneration) { diff --git a/public/scripts/variables.js b/public/scripts/variables.js index a3a8b6f9d..e05adcc86 100644 --- a/public/scripts/variables.js +++ b/public/scripts/variables.js @@ -492,7 +492,7 @@ async function executeSubCommands(command) { command = command.slice(0, -1); } - const unescape = true; + const unescape = false; const result = await executeSlashCommands(command, unescape); if (!result || typeof result !== 'object') {