Replace {{name}} macros in instruct suffixes

974f142f24724c76a649196301e0af8178856980

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -0Showing whitespace changes
public/scripts/instruct-mode.js+5 -0
@@ -333,6 +333,9 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
333 if (power_user.instruct.macro) {333 if (power_user.instruct.macro) {
334 prefix = substituteParams(prefix, name1, name2);334 prefix = substituteParams(prefix, name1, name2);
335 prefix = prefix.replace(/{{name}}/gi, name || 'System');335 prefix = prefix.replace(/{{name}}/gi, name || 'System');
336
337 suffix = substituteParams(suffix, name1, name2);
338 suffix = suffix.replace(/{{name}}/gi, name || 'System');
336 }339 }
337340
338 if (!suffix && power_user.instruct.wrap) {341 if (!suffix && power_user.instruct.wrap) {
@@ -398,6 +401,8 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) {
398401
399 inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);402 inputPrefix = inputPrefix.replace(/{{name}}/gi, name1);
400 outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);403 outputPrefix = outputPrefix.replace(/{{name}}/gi, name2);
404 inputSuffix = inputSuffix.replace(/{{name}}/gi, name1);
405 outputSuffix = outputSuffix.replace(/{{name}}/gi, name2);
401406
402 if (!inputSuffix && power_user.instruct.wrap) {407 if (!inputSuffix && power_user.instruct.wrap) {
403 inputSuffix = '\n';408 inputSuffix = '\n';