Skip to content

Commit

Permalink
Revert "bug: AutoLink URL recognition failures"
Browse files Browse the repository at this point in the history
New regular expression is complex and slow.

This reverts commit c5d0792.
  • Loading branch information
umaranis committed Mar 24, 2024
1 parent c5d0792 commit 5a9c4b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
const URL_REGEX =
/(https?:\/\/)?((\w+:\w+@)?(([a-zA-Z\d]([a-zA-Z\d-]*[a-zA-Z\d])*)\.)+[a-zA-Z]{2,}|localhost|(\d{1,3}\.){3}\d{1,3})(:\d+)?(\/[-a-zA-Z\d%_.~+]*)*(\?[;&a-zA-Z\d%_.~+=-]*)?(#[-a-zA-Z\d_]*)?/;
/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
const EMAIL_REGEX =
/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
return null;
}
const PUNCTUATION_OR_SPACE = /[,;\s]/;
const PUNCTUATION_OR_SPACE = /[.,;\s]/;
function isSeparator(char: string): boolean {
return PUNCTUATION_OR_SPACE.test(char);
Expand Down

0 comments on commit 5a9c4b2

Please sign in to comment.