markdown-it / linkify-it

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

Fix paths containing unencoded ` followed by punctuation #109

Open timjamello opened 1 year ago

timjamello commented 1 year ago

linkify-it currently supports apostrophes in the path, such as:

http://foo.com/blah_blah_I'm_king

However, there is no support for apostrophes followed by punctuation. This link is not found by linkify-it:

https://odysee.com/@EatMoreVegans:4/can-chefstemp-knock-thermoworks':0

What's happening here is that Odysee generates links using the first part of video titles. The title of the video linked above is "Can ChefsTemp Knock ThermoWorks' Thermapen One Off the Throne?". Their logic happens to end the path with the ' in the video title followed by punctuation.

Services that includes unencoded apostrophes in paths could follow that apostrophe with a number of different characters. Here's a Google Cache link that follows an unencoded ' with a (.

http://webcache.googleusercontent.com/search?q=cache:jkWRWOTPZXwJ:app.searchenabler.com/experiments/unsafe/%2520!%24%26'()*%2B,-.:%3B%253C%3D%253E%40%5B%255C%5D%255E_%2560%257B%257C%257D~+&cd=1&hl=en&ct=clnk

All three of these links are supported by my changes.

timjamello commented 1 year ago

@rlidwka do you think you could take a look at this?

I noticed there is another PR in this repo that has gone stale, and I just want to make sure this one gets looked at.

rlidwka commented 1 year ago

@rlidwka do you think you could take a look at this?

I don't think so, since I didn't write this code, and I don't have publish permissions, so ask @puzrin.