linkify-it icon indicating copy to clipboard operation
linkify-it copied to clipboard

Fix paths containing unencoded ` followed by punctuation

Open timjamello opened this issue 2 years ago • 2 comments

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 avatar Mar 30 '23 13:03 timjamello