From 11ab1ff677c04195db99f7a9b40676566e121a53 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Tue, 6 Oct 2026 03:51:04 +0200 Subject: [PATCH] fix(sonar): use replaceAll string instead of control-char regex (javascript:S6324) Co-Authored-By: Claude Sonnet 5.5 --- static/js/generation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.