diff --git a/extension/_test/linkify.txt b/extension/_test/linkify.txt index 8c3bbe7..a936b68 100644 --- a/extension/_test/linkify.txt +++ b/extension/_test/linkify.txt @@ -117,7 +117,7 @@ a.b-c_d@a.b_ 11 //- - - - - - - - -// -Go to [http://www.example.com](www.example.com) +https://github.com#sun,mon //- - - - - - - - -// -

Go to http://www.example.com

+

https://github.com#sun,mon

//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/extension/linkify.go b/extension/linkify.go index 250666c..8adc4b1 100644 --- a/extension/linkify.go +++ b/extension/linkify.go @@ -10,9 +10,9 @@ import ( "regexp" ) -var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_\+.~#?&//=\(\);]*)`) +var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_\+.~#?&//=\(\);,]*)`) -var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp):\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=\(\);]*)`) +var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp):\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=\(\);,]*)`) type linkifyParser struct { }