diff --git a/templates/tts_chunk_player/tts_chunk_player.html b/templates/tts_chunk_player/tts_chunk_player.html index 68c38da..21d3c6d 100644 --- a/templates/tts_chunk_player/tts_chunk_player.html +++ b/templates/tts_chunk_player/tts_chunk_player.html @@ -655,8 +655,7 @@ cleanedText = cleanedText.replace(/%/g, " percent"); cleanedText = cleanedText.replace(/\.\s'/g, ".'"); cleanedText = cleanedText.replace(/[^a-zA-Z0-9\s\.,;:!?\-\'"À-ÿ\u0400-\u04FF\u0150\u0151\u0170\u0171]\$/g, ''); - //let sentences = cleanedText.match(/("[^"]+"|[^.!?]+[.!?]+)/g); - let sentences = cleanedText.match(/(?:\d+\.\d+|[^\d.!?])+\b[.!?]+(?=\s|$)/g); + let sentences = cleanedText.split(/(?<=[.!?:])\s+/); if (!sentences) { console.error("No sentences found in the input text."); @@ -1666,4 +1665,4 @@ - \ No newline at end of file +