Skip to content

Commit 33be544

Browse files
authored
🐛 fix: outdated browser error (#23)
1 parent 26ab412 commit 33be544

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/utils/splitTextIntoSegments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const toHalfWidthAndCleanSpace = (str: string): string => {
2525
export const splitTextIntoSegments = (text: string, maxChars: number = 100): string[] => {
2626
text = toHalfWidthAndCleanSpace(text);
2727

28-
const sentences = text.split(/(?<=[!.;?])/g);
28+
const sentences = text.match(/[^.!;?]+[.!;?]+/g) || [];
2929
const segments: string[] = [];
3030
let currentSegment = '';
3131

0 commit comments

Comments
 (0)