Skip to content

Commit

Permalink
fix: Catastrophic backtracking regex condition (nteract#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tregoning committed Jul 18, 2021
1 parent 16394c2 commit b20bb18
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 b20bb18

Please sign in to comment.