mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
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:
@ -95,7 +95,7 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown,
|
|||||||
// Script applies to Generate and input is Generate
|
// Script applies to Generate and input is Generate
|
||||||
(script.promptOnly && isPrompt) ||
|
(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 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) {
|
if (isEdit && !script.runOnEdit) {
|
||||||
console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`);
|
console.debug(`getRegexedString: Skipping script ${script.scriptName} because it does not run on edit`);
|
||||||
|
@ -18,7 +18,7 @@ import { t } from '../../i18n.js';
|
|||||||
* @property {string} replaceString - The replace string
|
* @property {string} replaceString - The replace string
|
||||||
* @property {string[]} trimStrings - The trim strings
|
* @property {string[]} trimStrings - The trim strings
|
||||||
* @property {string?} findRegex - The find regex
|
* @property {string?} findRegex - The find regex
|
||||||
* @property {string?} substituteRegex - The substitute regex
|
* @property {number?} substituteRegex - The substitute regex
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user