diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index af3ab9a01..d80fcc799 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -525,7 +525,7 @@ export const extractSentences = (text) => { }); // Split the modified text into sentences based on common punctuation marks, avoiding these blocks - let sentences = text.match(/[^.?!]+[.!?]+[\])'"`’”]*|.+/g); + let sentences = text.split(/(?<=[.!?])\s+/); // Restore code blocks and process sentences sentences = sentences.map((sentence) => {