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

Support schemaless GitHub/GitLab urls #42

Open
egrieco opened this issue Jun 13, 2022 · 3 comments
Open

Support schemaless GitHub/GitLab urls #42

egrieco opened this issue Jun 13, 2022 · 3 comments

Comments

@egrieco
Copy link

egrieco commented Jun 13, 2022

URLs such as [email protected]:robinst/linkify.git are common when working with GitHub/GitLab repositories. It would be good if linkify could reliably detect the whole URL in such cases.

linkify web demo partially detecting github urls

I'm opening this issue to make others aware as well as to remind myself to fix this when I have time.

Related issues: #17 and #39

@robinst
Copy link
Owner

robinst commented Jul 11, 2022

Hm not sure about this, as it's not really a URL in the strictest sense – the full form like ssh://[email protected]/robinst/linkify.git is a URL and works with this library today.

To support this (thinking out loud), we'd need an option to recognize SSH style "URLs", and then we'd need to extend email address scanning to also handle those and be active if the option is enabled.

I'm going to leave this open to gauge further interest, but I'm not planning to work on it for now.

@egrieco
Copy link
Author

egrieco commented Jul 16, 2022

Fair points, but it doesn't sound like you are opposed to the feature.

Is there any objection if I work on this?

@egrieco
Copy link
Author

egrieco commented Sep 18, 2022

Need

The reason I think this is necessary is that both GitHub and Gitlab provide SSH urls to repos in this format by default e.g.

[email protected]:robinst/linkify.git

Ironically, the link auto-highlighting on GitHub has the same problem highlighting the full link.

Emails

I cannot find any spec for email or mailto: links showing a colon immediately after the final domain component of the final email address as being valid.

Ambiguity

I do realize that there is a possibility for ambiguity where the GitHub/GitLab username is fully numeric.

It might be a good idea to add a LinkKind::Ambiguous to handle cases that are not clear. Further, being able to specify a policy to disambiguate to one kind or other could help a lot.

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

No branches or pull requests

2 participants