Skip to content

Commit

Permalink
Remove use of regex lookbehind to improve compat with old Safari vers…
Browse files Browse the repository at this point in the history
…ions (#550)
  • Loading branch information
ExplodingCabbage authored Sep 2, 2024
1 parent e8db85e commit a8b639a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function overlapCount(a, b) {
* Returns true if the string consistently uses Windows line endings.
*/
export function hasOnlyWinLineEndings(string) {
return string.includes('\r\n') && !string.match(/(?<!\r)\n/);
return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
}

/**
Expand Down

0 comments on commit a8b639a

Please sign in to comment.