Unverified Commit f3c1ff9e authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3564 from wanderingmeow/fix-regexp-safari-before-16.4

fix: RegExp "invalid group specifier name" exception on Safari < 16.4
parents 4547afe0 de3d4900
......@@ -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) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment