From 3a1bf3ef81b38b12af182b556576d80baf50c3f7 Mon Sep 17 00:00:00 2001 From: Sanskar Tiwari Date: Sat, 13 May 2023 16:59:14 +0530 Subject: [PATCH] handle special quotes --- public/scripts/extensions/tts/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/tts/index.js b/public/scripts/extensions/tts/index.js index 347e27c61..ea395436a 100644 --- a/public/scripts/extensions/tts/index.js +++ b/public/scripts/extensions/tts/index.js @@ -246,7 +246,8 @@ async function processTtsQueue() { : currentTtsJob.mes.replaceAll('*', '').trim() // remove just the asterisks if (extension_settings.tts.narrate_quoted_only) { - // narrate only the text inside double quotes + const special_quotes = /[“”]/g; // Extend this regex to include other special quotes + text = text.replace(special_quotes, '"'); const matches = text.match(/".*?"/g); // Matches text inside double quotes, non-greedily text = matches ? matches.join(' ... ... ... ') : text; }