diff --git a/static/js/generation.js b/static/js/generation.js index 65e9971..1070088 100644 --- a/static/js/generation.js +++ b/static/js/generation.js @@ -83,7 +83,7 @@ async function mergeWavBlobs(blobs, gapMs = 0) { function splitTextIntoChunks(text, maxLen = 800) { const abbrev = /\b(Mr|Mrs|Ms|Dr|Prof|Sr|Jr|vs|etc|e\.g|i\.e)\.\s/g; const safe = text.replace(abbrev, m => m.replace('.', '\x00')); - const restore = s => s.replace(/\x00/g, '.'); + const restore = s => s.replaceAll('\x00', '.'); // Gather segments from each line: sentences first, then any remaining line text. // This ensures newline-delimited text (e.g. German bullet lists) gets split too.