cmark-gfm icon indicating copy to clipboard operation
cmark-gfm copied to clipboard

GFM autolink extension (`www.` part): the word `www` matches

Open wooorm opened this issue 3 years ago • 0 comments

a www. b

Yields:

a www. b


It seems that when www. is found, it is then parsed again as a domain, of which the dot makes it valid, and then it gets truncated to exclude the dot. Instead, I think a domain (with a dot) should be parsed after www..

a www.example b (probably not this one either)
a www.example.com b (this should of course work)

a www.example b (probably not this one either) a www.example.com b (this should of course work)


Aside, it seems like dots aren’t needed at all:

https://example.com

https://example

http://example.com

http://example.com

www.example.com

www.example

https://example.com

https://example

http://example.com

http://example.com

www.example.com

www.example

wooorm avatar Sep 02 '22 10:09 wooorm