Regex: fix "Alter Outgoing Prompt" applying when unchecked (#3380) * Regex: rework ephemerality options. * Fix ephemeral regex being executed when unwanted * Revert to old code style

a6a7810be2cb3bb7db4dca5a16fdac65e518e97d

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

Signed
2 files changed, +2 -2Ignore whitespace
public/scripts/extensions/regex/engine.js+1 -1
@@ -95,7 +95,7 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown,
95 // Script applies to Generate and input is Generate95 // Script applies to Generate and input is Generate
96 (script.promptOnly && isPrompt) ||96 (script.promptOnly && isPrompt) ||
97 // Script applies to all cases when neither "only"s are true, but there's no need to do it when `isMarkdown`, the as source (chat history) should already be changed beforehand97 // Script applies to all cases when neither "only"s are true, but there's no need to do it when `isMarkdown`, the as source (chat history) should already be changed beforehand
98 (!script.markdownOnly && !script.promptOnly && !isMarkdown)98 (!script.markdownOnly && !script.promptOnly && !isMarkdown && !isPrompt)
99 ) {99 ) {
100 if (isEdit && !script.runOnEdit) {100 if (isEdit && !script.runOnEdit) {
101 console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`);101 console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`);
public/scripts/extensions/regex/index.js+1 -1
@@ -18,7 +18,7 @@ import { t } from '../../i18n.js';
18 * @property {string} replaceString - The replace string18 * @property {string} replaceString - The replace string
19 * @property {string[]} trimStrings - The trim strings19 * @property {string[]} trimStrings - The trim strings
20 * @property {string?} findRegex - The find regex20 * @property {string?} findRegex - The find regex
21 * @property {string?} substituteRegex - The substitute regex21 * @property {number?} substituteRegex - The substitute regex
22 */22 */
2323
24/**24/**