Skip to content

Commit fa8a84c

Browse files
authored
fix: Catastrophic backtracking regex condition (#64) (#65)
1 parent 16394c2 commit fa8a84c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function convertBundleIntoReact(
101101
}
102102

103103
const content: React.ReactNode[] = [];
104-
const linkRegex = /(\s+|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
104+
const linkRegex = /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
105105

106106
let index = 0;
107107
let match: RegExpExecArray | null;

0 commit comments

Comments
 (0)