From 869108a3e1ce2b8110084113c1b392072e98fd5f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 9 Jan 2026 19:08:35 +0400 Subject: [PATCH] refac: tts split --- src/lib/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index a7a0fca32..265c47cec 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -894,8 +894,8 @@ export const extractSentences = (text: string) => { return placeholder; }); - // Split the modified text into sentences based on common punctuation marks, avoiding these blocks - let sentences = text.split(/(?<=[.!?])\s+/); + // Split the modified text into sentences based on common punctuation marks or newlines, avoiding these blocks + let sentences = text.split(/(?<=[.!?])\s+|\n+/); // Restore code blocks and process sentences sentences = sentences.map((sentence) => {