Skip to content

Commit a8b639a

Browse files
Remove use of regex lookbehind to improve compat with old Safari versions (#550)
1 parent e8db85e commit a8b639a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function overlapCount(a, b) {
9292
* Returns true if the string consistently uses Windows line endings.
9393
*/
9494
export function hasOnlyWinLineEndings(string) {
95-
return string.includes('\r\n') && !string.match(/(?<!\r)\n/);
95+
return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
9696
}
9797

9898
/**

0 commit comments

Comments
 (0)