mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@ -8,7 +8,7 @@ import { enumIcons } from '../../slash-commands/SlashCommandCommonEnumsProvider.
|
||||
import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashCommandEnumValue.js';
|
||||
import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
|
||||
import { download, getFileText, getSortableDelay, uuidv4 } from '../../utils.js';
|
||||
import { regex_placement, runRegexScript } from './engine.js';
|
||||
import { regex_placement, runRegexScript, substitute_find_regex } from './engine.js';
|
||||
import { t } from '../../i18n.js';
|
||||
|
||||
/**
|
||||
@ -227,7 +227,7 @@ async function onRegexEditorOpenClick(existingId, isScoped) {
|
||||
editorHtml.find('input[name="only_format_display"]').prop('checked', existingScript.markdownOnly ?? false);
|
||||
editorHtml.find('input[name="only_format_prompt"]').prop('checked', existingScript.promptOnly ?? false);
|
||||
editorHtml.find('input[name="run_on_edit"]').prop('checked', existingScript.runOnEdit ?? false);
|
||||
editorHtml.find('input[name="substitute_regex"]').prop('checked', existingScript.substituteRegex ?? false);
|
||||
editorHtml.find('select[name="substitute_regex"]').val(existingScript.substituteRegex ?? substitute_find_regex.NONE);
|
||||
editorHtml.find('input[name="min_depth"]').val(existingScript.minDepth ?? '');
|
||||
editorHtml.find('input[name="max_depth"]').val(existingScript.maxDepth ?? '');
|
||||
|
||||
@ -267,7 +267,7 @@ async function onRegexEditorOpenClick(existingId, isScoped) {
|
||||
findRegex: editorHtml.find('.find_regex').val(),
|
||||
replaceString: editorHtml.find('.regex_replace_string').val(),
|
||||
trimStrings: String(editorHtml.find('.regex_trim_strings').val()).split('\n').filter((e) => e.length !== 0) || [],
|
||||
substituteRegex: editorHtml.find('input[name="substitute_regex"]').prop('checked'),
|
||||
substituteRegex: Number(editorHtml.find('select[name="substitute_regex"]').val()),
|
||||
};
|
||||
const rawTestString = String(editorHtml.find('#regex_test_input').val());
|
||||
const result = runRegexScript(testScript, rawTestString);
|
||||
@ -295,7 +295,7 @@ async function onRegexEditorOpenClick(existingId, isScoped) {
|
||||
markdownOnly: editorHtml.find('input[name="only_format_display"]').prop('checked'),
|
||||
promptOnly: editorHtml.find('input[name="only_format_prompt"]').prop('checked'),
|
||||
runOnEdit: editorHtml.find('input[name="run_on_edit"]').prop('checked'),
|
||||
substituteRegex: editorHtml.find('input[name="substitute_regex"]').prop('checked'),
|
||||
substituteRegex: Number(editorHtml.find('select[name="substitute_regex"]').val()),
|
||||
minDepth: parseInt(String(editorHtml.find('input[name="min_depth"]').val())),
|
||||
maxDepth: parseInt(String(editorHtml.find('input[name="max_depth"]').val())),
|
||||
};
|
||||
|
Reference in New Issue
Block a user