Skip to content

Commit

Permalink
Merge pull request #3564 from wanderingmeow/fix-regexp-safari-before-…
Browse files Browse the repository at this point in the history
…16.4

fix: RegExp "invalid group specifier name" exception on Safari < 16.4
  • Loading branch information
tjbck committed Jul 1, 2024
2 parents 4547afe de3d490 commit f3c1ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit f3c1ff9

Please sign in to comment.