-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I have a url, https://medianewsletter.net/lets-give-reader-comments-another-chance-and-for-real-this-time-77506d29856b?source=user_profile---------9---------------- which results in an empty output. If I change it to not end with a dash all works fine.
I can remove the dash from
php-linkify/src/Misd/Linkify/Linkify.php
Line 161 in 3481b14
| [^\s`!\-()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars |
php-linkify/tests/data/url.json
Lines 70 to 71 in 3481b14
| "test": "http://www.example.com/example-example/-", | |
| "expected": "<a href=\"http://www.example.com/example-example/\">http://www.example.com/example-example/</a>-" |
I don't really understand the requirements here. I could understand if there is a dash in front of the url as well (-http://www.example.com/example-example/-) as it is similar to brackets. But only one at the end should be considered part of the url I would say. E.g. taking into account poorly-written slugify services which don't strip dashes at the end of a slug.
Is it something that can go? Anyone passing by who happens to rely on this behavior?