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() {
483483 text = matches ? matches.join(partJoiner) : text;
484484 }
485485
486+ // Remove embedded images
487+ text = text.replace(/!\[alt-text]\([^)]*\)/g, ' ');
488+
486489 if (typeof ttsProvider?.processText === 'function') {
487490 text = await ttsProvider.processText(text);
488491 }