svelte-markdown icon indicating copy to clipboard operation
svelte-markdown copied to clipboard

How to use at `@` character?

Open hugotox opened this issue 1 year ago • 5 comments

If I try to use the at character, it renders a big string of bad characters. Any idea how to escape it?

e.g.

<SvelteMarkdown source="[email protected]" />

Renders:

[&#x68;&#101;&#108;&#x6c;&#x6f;&#64;&#x6d;&#97;&#105;&#x6c;&#x2e;&#x63;&#111;&#109;](mailto:&#x68;&#101;&#108;&#x6c;&#x6f;&#64;&#x6d;&#97;&#105;&#x6c;&#x2e;&#x63;&#111;&#109;)

hugotox avatar Jan 14 '24 04:01 hugotox

According to this https://www.markdownguide.org/basic-syntax/#urls-and-email-addresses and this https://github.com/markedjs/marked/issues/2397 it should only be a link when wrapped with <...> but it just doesn't work. I now use backticks so it's treated as code but I'm not happy

domhel avatar Jan 22 '24 17:01 domhel

Links work, just the @ character alone fails. See my example here https://stackblitz.com/edit/sveltejs-kit-template-default-burzvt?file=src%2Froutes%2F%2Bpage.svelte

hugotox avatar Jan 22 '24 18:01 hugotox

@hugotox did you manage to get around this?

williamoverton avatar May 08 '24 14:05 williamoverton

@hugotox did you manage to get around this?

Yes, kindof. The character @ as it is doesn't work, but you can use the html entity &#64;. Also if rendering an email address then it works fine, e.g. [[email protected]](mailto:[email protected])

hugotox avatar May 08 '24 14:05 hugotox

Ran into the same issue. Solution is mentioned here: https://github.com/pablo-abc/svelte-markdown/issues/50

OrkhanAlikhanov avatar Aug 29 '24 14:08 OrkhanAlikhanov

mangle: false doesn't work for me, how does anyone manage to unescape HTML entities?

dreamscached avatar Oct 11 '24 09:10 dreamscached