Remove embedded images before send text to TTS

8b32ee9e8058ac0a337659913b656b0764bbeaa6

Yaroslav Sivakov <yar3333@gmail.com>

1 files changed, +3 -0Showing whitespace changes
public/scripts/extensions/tts/index.js+3 -0
@@ -483,6 +483,9 @@ async function processTtsQueue() {
483 text = matches ? matches.join(partJoiner) : text;483 text = matches ? matches.join(partJoiner) : text;
484 }484 }
485485
486 // Remove embedded images
487 text = text.replace(/!\[alt-text]\([^)]*\)/g, ' ');
488
486 if (typeof ttsProvider?.processText === 'function') {489 if (typeof ttsProvider?.processText === 'function') {
487 text = await ttsProvider.processText(text);490 text = await ttsProvider.processText(text);
488 }491 }