diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index d80fcc799..af3ab9a01 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.split(/(?<=[.!?])\s+/); + let sentences = text.match(/[^.?!]+[.!?]+[\])'"`’”]*|.+/g); // Restore code blocks and process sentences sentences = sentences.map((sentence) => {