mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-18 21:20:39 +01:00
Fix tts.skip_tags's regex to match newlines
The extension_settings.tts.skip_tags setting is meant to skip sending tags and their content to the TTS API provider. The original regular expression matched content inside tags with ".*?". Unfortunately, Javascript's engine does *not* match newlines on the "." without the /s flag. The /s flag was added in ES2018. To be more compatible, the regex has been changed to "[\s\S]+?". This gives similar performance (instead of using capture groups) and matches all content within a tag, as the original regex intended.
This commit is contained in:
parent
3b8fd6f62f
commit
145136059e
@ -466,7 +466,7 @@ async function processTtsQueue() {
|
||||
}
|
||||
|
||||
if (extension_settings.tts.skip_tags) {
|
||||
text = text.replace(/<.*?>.*?<\/.*?>/g, '').trim();
|
||||
text = text.replace(/<.*?>[\s\S]*?<\/.*?>/g, '').trim();
|
||||
}
|
||||
|
||||
if (!extension_settings.tts.pass_asterisks) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user