mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
#1630 Fix regex depth application
This commit is contained in:
parent
bdf7602fab
commit
b7921f1edd
@ -73,12 +73,12 @@ function getRegexedString(rawString, placement, { characterOverride, isMarkdown,
|
|||||||
) {
|
) {
|
||||||
// Check if the depth is within the min/max depth
|
// Check if the depth is within the min/max depth
|
||||||
if (typeof depth === 'number' && depth >= 0) {
|
if (typeof depth === 'number' && depth >= 0) {
|
||||||
if (!isNaN(script.minDepth) && script.minDepth >= 0 && depth < script.minDepth) {
|
if (!isNaN(script.minDepth) && script.minDepth !== null && script.minDepth >= 0 && depth < script.minDepth) {
|
||||||
console.debug(`getRegexedString: Skipping script ${script.scriptName} because depth ${depth} is less than minDepth ${script.minDepth}`);
|
console.debug(`getRegexedString: Skipping script ${script.scriptName} because depth ${depth} is less than minDepth ${script.minDepth}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNaN(script.maxDepth) && script.maxDepth >= 0 && depth > script.maxDepth) {
|
if (!isNaN(script.maxDepth) && script.maxDepth !== null && script.maxDepth >= 0 && depth > script.maxDepth) {
|
||||||
console.debug(`getRegexedString: Skipping script ${script.scriptName} because depth ${depth} is greater than maxDepth ${script.maxDepth}`);
|
console.debug(`getRegexedString: Skipping script ${script.scriptName} because depth ${depth} is greater than maxDepth ${script.maxDepth}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user