gregjacobs / Autolinker.js

Utility to Automatically Link URLs, Email Addresses, Phone Numbers, Twitter handles, and Hashtags in a given block of text/HTML
MIT License
1.48k stars 238 forks source link

URLs with periods parsed incorrectly #261

Closed brenc closed 5 years ago

brenc commented 5 years ago

Devuan Jessie x64 (Debian Jessie w/o systemd) Node: v8.15.0 Autolinker 3.0.0

I've noticed that URLs like this aren't getting parsed correctly and haven't been for as long as I can remember:

https://images-na.ssl-images-amazon.com/images/I/912ozjp0ytL._SY450_.jpg

This is the resulting URL that gets linked:

https://images-na.ssl-images-amazon.com/images/I/912ozjp0ytL

Please let me know if there is a better way of reporting this. I dug around closed tickets but couldn't find anything.

Great project BTW. It's been very useful to us over the years.

gregjacobs commented 5 years ago

Hey @brenc, thanks for reporting this! Will look into it asap

gregjacobs commented 5 years ago

Hey @brenc. So I'm finally getting a change to look at this, but I can't seem to reproduce it. Here's what I get on my machine:

~/dev/test $ npm install autolinker@3.0.1
~/dev/test $ node -e 'var autolinker=require("autolinker"); console.log(autolinker.link("https://images-na.ssl-images-amazon.com/images/I/912ozjp0ytL._SY450_.jpg", {newWindow: false}));'
# <a href="https://images-na.ssl-images-amazon.com/images/I/912ozjp0ytL._SY450_.jpg">images-na.ssl-images-amazon.com/images/I/912ozjp0ytL._SY450_.jpg</a>

I added some additional tests to the project just to confirm, and I also tried plugging it into the live example page and it seems to work: http://greg-jacobs.com/Autolinker.js/examples/index.html

Can you try that above command on your machine? Is that what you get?

Do you maybe have some different Autolinker settings enabled btw?

brenc commented 5 years ago

Oops - boy do I feel dumb! Turns out this is on our end. Sorry about that!

gregjacobs commented 5 years ago

Hehe, no worries! Glad to hear you figured it out!

And glad to hear it wasn't a bug in Autolinker :D

Best, Greg