Skip to content

Commit

Permalink
fix: Catastrophic backtracking regex condition (#64) (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tregoning authored Jul 29, 2021
1 parent 16394c2 commit fa8a84c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function convertBundleIntoReact(
}

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

let index = 0;
let match: RegExpExecArray | null;
Expand Down

0 comments on commit fa8a84c

Please sign in to comment.