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

Links in angle brackets <urlscheme://example> #743

Closed
vibrog opened this issue Jan 24, 2023 · 3 comments
Closed

Links in angle brackets <urlscheme://example> #743

vibrog opened this issue Jan 24, 2023 · 3 comments

Comments

@vibrog
Copy link

vibrog commented Jan 24, 2023

Highlight links in angle brackets <urlscheme://example>, according to
https://spec.commonmark.org/0.30/#link-destination
https://www.markdownguide.org/basic-syntax#urls-and-email-addresses

@syohex
Copy link
Collaborator

syohex commented Jan 24, 2023

I suppose markdown-mode already implements highlighting links in angle brackets. Could you show us reproduce markdown text of your issue ?

@syohex syohex closed this as completed Feb 24, 2023
@vibrog
Copy link
Author

vibrog commented Feb 26, 2023

Examples

- https://example.com/ // <https://example.com/>
- mailto:nobody@example.com // <mailto:nobody@example.com>
- uri://example.com // <uri://example.com>
- tel:+555 // <tel:+555>
- geo:59.5,11.0 // <geo:59.5,11.0>
- irc://example.com/channel // <irc://example.com/channel>
- <x-web-search://>
- <x-apple-reminder://>

Screenshot 2023-02-26 at 15 10 23

Screen capture of Markdown mode version 2.6-alpha

Generic URIs

I think that all links inside <>-brackets should support any URL starting with any legal URI scheme, not just URI-schemes known to Markdown-mode. It is still convenient that Markdown-mode will linkify well-known URIs typed without the <>-brackets. According to RFC3986:

scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

So essentially match this regexp: <[a-z][a-z0-9.+-]:[^>]*>

See also Uniform Resource Identifier (URI) on Wikipedia.

@syohex
Copy link
Collaborator

syohex commented Feb 27, 2023

I have merged #751

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

2 participants