postcards icon indicating copy to clipboard operation
postcards copied to clipboard

Can't add a Mastodon link in links and labels

Open RMRubert opened this issue 2 years ago • 6 comments

Hello,

so when a mastodon link (that contains an @) is added, the render doesn't happen properly.

Example: `--- title: "Name"

links:

  • label: LinkedIn url: "https://www.linkedin.com/in/blablabla/"
  • label: Mastodon url: "https://im-in.space/@blablabla" output: postcards::trestles ---`

imagen

Is there any way to force the url to not swap mode when the @ is added?

RMRubert avatar Apr 28 '22 19:04 RMRubert

I tried replacing the @ with %40, it does compiles correctly, but the link gives me a 404. At least on firefox. https://im-in.space/@rmrubert https://im-in.space/%40rmrubert

RMRubert avatar Apr 28 '22 19:04 RMRubert

Same. Others have posted on this here: https://mastodon.social/@ajamesgreen/109341659266526443

It looks like the @ symbol in the url is being rendered as a citation. Not sure if this is something that can be handled via {postcards} or if it should be handled in {distill}.

@cderv any thoughts?

jhelvy avatar Nov 14 '22 13:11 jhelvy

Thanks for being my post across to here @jhelvy

limegreen avatar Nov 14 '22 20:11 limegreen

Usually when you want to add a @ in a doc where citation is activated, you need to escape it using \ so I would try \@ .

Usually any special markdown character (and @ is among them as used for citation) needs to be escaped when wished to be showed verbatim asis https://bookdown.org/yihui/rmarkdown-cookbook/special-chars.html

Hopefully, this is what happens here. This would mean the link added in YAML is processed as Markdown or inserted in a pre render step.

cderv avatar Nov 14 '22 21:11 cderv

Welp, that did it! Except I needed to use \\, like this:

  - label: '<i class="fab fa-mastodon fa-lg"></i>'
    url: "https://fediscience.org/\\@jhelvy"

jhelvy avatar Nov 14 '22 21:11 jhelvy

Glad to have come across this thread! Thank you @cderv and @jhelvy.

rdelrossi avatar Aug 03 '23 22:08 rdelrossi