mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 19:07:40 +01:00
unescape args before calling callback
This commit is contained in:
parent
4d534e3042
commit
2cdf928fc7
@ -1565,6 +1565,19 @@ async function executeSlashCommands(text, unescape = false) {
|
|||||||
unnamedArg = unnamedArg.replace(/{{pipe}}/i, pipeResult ?? '');
|
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);
|
pipeResult = await result.command.callback(result.args, unnamedArg);
|
||||||
|
|
||||||
if (result.command.interruptsGeneration) {
|
if (result.command.interruptsGeneration) {
|
||||||
|
@ -492,7 +492,7 @@ async function executeSubCommands(command) {
|
|||||||
command = command.slice(0, -1);
|
command = command.slice(0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const unescape = true;
|
const unescape = false;
|
||||||
const result = await executeSlashCommands(command, unescape);
|
const result = await executeSlashCommands(command, unescape);
|
||||||
|
|
||||||
if (!result || typeof result !== 'object') {
|
if (!result || typeof result !== 'object') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user