#prevent automatic email address linking
3 messages · Page 1 of 1 (latest)
Hi @pearl dove. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To prevent Markdown from automatically turning email addresses like [email protected] into clickable links, you have a few options in Astro:
Option 1: Escape special characters
You can escape the @ symbol in your email address using HTML entities:
hello@example.com
As mentioned in the Astro documentation, certain characters have special meaning in Markdown, and you can use HTML entities to display them without triggering their special functionality:
Option 2: Disable GitHub-Flavored Markdown
Astro uses GitHub-Flavored Markdown (GFM) by default, which includes automatic URL and email linking. You can disable this feature in your astro.config.mjs file:
export default defineConfig({
markdown: {
gfm: false,
}
});
This will disable all GitHub-Flavored Markdown features, including automatic email linking:
Option 3: Use a custom remark plugin
If you want more fine-grained control, you could create a custom remark plugin that specifically prevents email auto-linking while keeping other GFM features.