Skip to content

Commit

Permalink
bug: AutoLink URL recognition failures
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Mar 24, 2024
1 parent be7a196 commit c5d0792
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
const URL_REGEX =
/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
/(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_]*)?/;
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
Loading

0 comments on commit c5d0792

Please sign in to comment.