markdown-it / linkify-it

Links recognition library with full unicode support
http://markdown-it.github.io/linkify-it/
MIT License
664 stars 63 forks source link

URL not detected correctly #60

Closed cesarfd closed 6 years ago

cesarfd commented 6 years ago

It is an unusually long url: https://runkit.com/embed/msue73ku8uor

There's a part in the url, hYnNlZw.._Jcrrel. It seems the parser stops considering anything pass the .. string.

puzrin commented 6 years ago

This package is for human-readable texts, not for any possible autogenerated URLs. I would not change mainstream rules, but you can fix those in your own fork, all regexps are commented.

cesarfd commented 6 years ago

Anyway, it seems that the problem is not the .. but the .._. That's what somehow breaks the parsing. Any idea what should I modify to make it work?

Is it in re.src_path?

puzrin commented 6 years ago

https://github.com/markdown-it/linkify-it/blob/cbc0833d3355dc04122c7a666122a61e58392555/lib/re.js#L59

cesarfd commented 6 years ago

Thank you!

It worked just by changing it to \\.{2,3}[a-zA-Z0-9%_/]|. I guess you prefer to keep it your way, right?