Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linkify an url ending with a dash fails #29

Open
lode opened this issue Apr 16, 2018 · 0 comments
Open

Linkify an url ending with a dash fails #29

lode opened this issue Apr 16, 2018 · 0 comments

Comments

@lode
Copy link

lode commented Apr 16, 2018

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

[^\s`!\-()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
and it is fixed. However a test will fails which explicitly tests this:
"test": "http://www.example.com/example-example/-",
"expected": "<a href=\"http://www.example.com/example-example/\">http://www.example.com/example-example/</a>-"
which is assumed to let the dash be excluded from the url.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant