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

Parentheses in URLs break linkifying #28

Open
hkdobrev opened this issue Nov 7, 2017 · 5 comments
Open

Parentheses in URLs break linkifying #28

hkdobrev opened this issue Nov 7, 2017 · 5 comments
Labels

Comments

@hkdobrev
Copy link

hkdobrev commented Nov 7, 2017

@fregante edit: Issue transferred from refined-github. This issue still happens in v3.1.0

Screenshot 2019-09-07 at 14 57 46


See this line:

The URL contains parentheses which make the anchor cut off the URL in both the href and the visual link producing a wrong URL.

Original valid URL:

https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
@fregante
Copy link
Collaborator

fregante commented Nov 8, 2017

Context: aca71b8

TL;DR: support was removed because we don't want the final ) inside markdown to be matched, .e.g [github](https://github.com) -> https://github.com)

@hkdobrev
Copy link
Author

hkdobrev commented Nov 8, 2017

I think this should be covered by a more sophisticated regex which would make the matching non-greedy for the last parenthesis if it detects a markdown link. This may prove difficult, though and we could work around it by detecting if you're looking at markdown or not.

@sindresorhus
Copy link
Owner

See: kevva/url-regex#35 (comment) I think this can be fixed now. We need to use the lookbehind operator in the url-regex module and then use it in linkify-urls again.

@fregante

This comment has been minimized.

@fregante fregante transferred this issue from refined-github/refined-github Sep 7, 2019
@fregante fregante added the bug label Sep 7, 2019
@fregante
Copy link
Collaborator

fregante commented Sep 7, 2019

I transferred the issue here because this can't be solved in Refined GitHub

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

No branches or pull requests

3 participants