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
This commit is contained in:
Cohee
2025-01-29 11:39:32 +02:00
committed by GitHub
parent 9e8fd3f5a0
commit a6a7810be2
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown,
// Script applies to Generate and input is Generate
(script.promptOnly && isPrompt) ||
// 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
(!script.markdownOnly && !script.promptOnly && !isMarkdown)
(!script.markdownOnly && !script.promptOnly && !isMarkdown && !isPrompt)
) {
if (isEdit && !script.runOnEdit) {
console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`);