Skip to content

Commit

Permalink
馃悰 fix: outdated browser error (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mushan0x0 committed Jan 3, 2024
1 parent 26ab412 commit 33be544
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/utils/splitTextIntoSegments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const toHalfWidthAndCleanSpace = (str: string): string => {
export const splitTextIntoSegments = (text: string, maxChars: number = 100): string[] => {
text = toHalfWidthAndCleanSpace(text);

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

Expand Down

0 comments on commit 33be544

Please sign in to comment.