linkifyjs icon indicating copy to clipboard operation
linkifyjs copied to clipboard

Special Characters at end of url are not recognized as part of it

Open lepult opened this issue 2 years ago • 1 comments

Special Characters at the end of a URL aren't recognised as a part of it, even though they should be. If a letter is added after the special character, it is recognised as part of the url.

Example:

linkify.find('test.com/?test=)'); // returns object with value === "test.com/?test=". Expected closing bracket at end of it.
linkify.find('test.com/?test=)a'); // returns object with value === "test.com/?test=)a"

lepult avatar Nov 29 '23 13:11 lepult

any updates?

CHOYSEN avatar Sep 12 '24 02:09 CHOYSEN

Hi @lepult and @CHOYSEN, apologies for the delay. This is unfortunately the intended behaviour. Specifically, URLs cannot end in a closing parentheses. You'll notice that Github's autolink works similarly: http://test.com/?test=)

I will accept pull requests if anyone wants to implementing a workable solution to this, but for now I'm marking this as not planned.

nfrasser avatar Dec 04 '24 05:12 nfrasser