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

use standard example.com domain for code sample #5031

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/docs/en/guides/markdown-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ I can link internally to [my conclusion](#conclusion) on the same page when writ
I can use the URL `https://my-domain.com/page-1/#introduction` to navigate directly to my Introduction on the page.
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved
```

Astro uses [github-slugger](https://github.com/Flet/github-slugger) to automatically assign generated IDs to all headings in Markdown files. If a heading already has a custom ID, it will be preserved and not overwritten.

The automatic IDs are added after all other Markdown plugins have been executed. So, if you want to use a plugin like [rehype-toc](https://github.com/JS-DevTools/rehype-toc), which requires heading IDs beforehand, you should also include your own slugging plugin like [rehype-slug](https://github.com/rehypejs/rehype-slug).

sarah11918 marked this conversation as resolved.
Show resolved Hide resolved
### Escaping special characters

Certain characters have a special meaning in Markdown and MDX. You may need to use a different syntax if you want to display them. To do this, you can use [HTML entities](https://developer.mozilla.org/en-US/docs/Glossary/Entity) for these characters instead.
Expand Down