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
Signed| @@ -95,7 +95,7 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown, | ||
| 95 | 95 | // Script applies to Generate and input is Generate |
| 96 | 96 | (script.promptOnly && isPrompt) || |
| 97 | 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 beforehand |
| 98 | 98 | (!script.markdownOnly && !script.promptOnly && !isMarkdown && !isPrompt) |
| 99 | 99 | ) { |
| 100 | 100 | if (isEdit && !script.runOnEdit) { |
| 101 | 101 | console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`); |
| @@ -18,7 +18,7 @@ import { t } from '../../i18n.js'; | ||
| 18 | 18 | * @property {string} replaceString - The replace string |
| 19 | 19 | * @property {string[]} trimStrings - The trim strings |
| 20 | 20 | * @property {string?} findRegex - The find regex |
| 21 | 21 | * @property {stringnumber?} substituteRegex - The substitute regex |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | /** |