Markdown In Astro 7
Astro 7 changes the default Markdown and MDX processor from unified to Sätteri.
Sätteri uses a Rust parser and JavaScript plugin layer. It is faster for large Markdown-heavy sites, but it is not a drop-in replacement for unified plugins.
Decision Table
| Your Project | Recommendation |
|---|---|
| Basic Markdown and MDX | Use the default Sätteri pipeline |
| Uses GFM, smart punctuation, heading IDs | Try Sätteri first; these are built in or covered by Astro defaults |
| Uses remark/rehype plugins | Decide whether to port or temporarily stay on unified |
| Uses recma plugins | Stay on unified for now |
| Has custom MDX behavior | Test MDX output carefully after upgrade |
Default Sätteri Configuration
You usually do not need to configure it. When you do, set the Markdown processor explicitly:
import { defineConfig } from 'astro/config';
import { satteri } from '@astrojs/markdown-satteri';
export default defineConfig({
markdown: {
processor: satteri({
features: { gfm: false },
}),
},
});
Keep Unified When You Need Existing Plugins
If the site depends on existing remark, rehype, or recma plugins, keep unified while you migrate:
npm install @astrojs/markdown-remark
import { defineConfig } from 'astro/config';
import { unified } from '@astrojs/markdown-remark';
import remarkToc from 'remark-toc';
export default defineConfig({
markdown: {
processor: unified({
remarkPlugins: [remarkToc],
}),
},
});
Gotcha: Sätteri’s AST shapes are familiar if you know MDAST/HAST, but its plugin API is not unified’s plugin API. Existing remark/rehype plugins do not run unmodified.
MDX Inherits Markdown Config
Astro’s MDX integration extends your Markdown configuration by default. Override processor in the MDX integration if .mdx needs different behavior from .md:
import { defineConfig } from 'astro/config';
import { satteri } from '@astrojs/markdown-satteri';
import mdx from '@astrojs/mdx';
export default defineConfig({
markdown: {
processor: satteri(),
},
integrations: [
mdx({
processor: satteri({ features: { directive: true } }),
}),
],
});
Upgrade Strategy
Do this in order:
- Upgrade and run the build with Sätteri default.
- Compare rendered Markdown/MDX output on pages that use plugins.
- If output changes, switch to unified to unblock the upgrade.
- Port plugin behavior to Sätteri only when the performance win matters.