github / cmark-gfm

GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wooorm opened this issue · comments

commented
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