syntax-tree / mdast-util-gfm-autolink-literal

mdast extension to parse and serialize GFM autolink literals
https://unifiedjs.com
MIT License
8 stars 6 forks source link

Suggestion: Support For Mastodon Addresses #7

Closed lexi-the-cute closed 1 year ago

lexi-the-cute commented 1 year ago

Initial checklist

Problem

I would like to ask if Mastodon addresses such as @alexis@alexisart.me were supported like their email counterparts. I'm currently working on finding out what the standard protocol is for Mastodon based activity (e.g. the Mastodon equivalent of mailto). https://chat.alexisart.me/@alexis/110014274893325451

Given that the nature of the protocol not existing at the moment, this feature request will not be able to be implemented at the moment unless we are going to route of looking up the HTTP URL via webfinger.

Solution

Detect a Mastodon address and transform it into a usable link

Alternatives

Create the link manually

Murderlon commented 1 year ago

Hi! All the GFM extensions strictly follow the GitHub Flavoured Markdown spec so if GitHub doesn't support it, we almost never deviate from it. I'd say that's probably the case here too and support for this can be added as a separate custom extension.

wooorm commented 1 year ago

Hi Alexis!

That’s a good use case!

I'm currently working on finding out what the standard protocol is for Mastodon based activity

Looks like someone already mentioned this in your thread, but: https://github.com/mastodon/mastodon/issues/19679#issuecomment-1301180085.


Rest is as Merlijn comments :)


You can make something like this yourself though, with https://github.com/syntax-tree/hast-util-find-and-replace likely!!

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] commented 1 year ago

Hi team! Could you describe why this has been marked as external?

Thanks, — bb

lexi-the-cute commented 1 year ago

Thanks! I will have to figure out how to stop this module from treating Mastodon addresses like they are email addresses. For example, @alexis@alexisart.me is transformed into @<a href="mailto:alexis@alexisart.me">alexis@alexisart.me</a> instead of being left alone as just plain text, @alexis@alexisart.me.

wooorm commented 1 year ago

Hey, I meant to respond but forgot: I don’t have a quick answer on your needs, because as you see here on GitHub, that’s just how it works here! You’ll also see it on Twitter!

Some ideas:

a) try to get GitHub to support this! It shouldn’t be super hard technically (very similar to https://github.com/github/cmark-gfm/pull/274). The bad part is that GitHub does not take suggestions, does not respond to issues, basically never changes. The good part is that GH recently supported mastodon addresses on profiles, so there’s some precedence. b) Use code @alexis@alexisart.me, because it isn’t really human English prose c) Create manual links: [@alexis@alexisart.me](link/to/server) -> @alexis@alexisart.me :'(