Skip to content
Merged
6 changes: 6 additions & 0 deletions .changeset/satteri-0-10-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@astrojs/markdown-satteri': patch
'@astrojs/mdx': patch
---

Updates Sätteri processor to v0.10.1. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#0101--2026-08-18) for details on bugs fixed and features added.
2 changes: 1 addition & 1 deletion packages/integrations/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"remark-math": "^6.0.0",
"remark-rehype": "^11.1.2",
"remark-toc": "^9.0.0",
"satteri": "^0.9.1",
"satteri": "^0.10.1",
"shiki": "^4.0.2",
"unified": "^11.0.5",
"vite": "^8.0.13"
Expand Down
3 changes: 1 addition & 2 deletions packages/markdown/satteri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"@astrojs/internal-helpers": "workspace:*",
"@astrojs/prism": "workspace:*",
"github-slugger": "^2.0.0",
"hast-util-from-html": "^2.0.3",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

"satteri": "^0.9.1"
"satteri": "^0.10.1"
},
"devDependencies": {
"astro-scripts": "workspace:*"
Expand Down
5 changes: 3 additions & 2 deletions packages/markdown/satteri/src/satteri-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ export async function createHighlightFn(

if (syntaxHighlightType === 'prism') {
const { runHighlighterWithAstro } = await import('@astrojs/prism/dist/highlighter');
const { fromHtml } = await import('hast-util-from-html');
const { htmlToHast } = await loadSatteri();
return async (code, lang) => {
const { html, classLanguage } = await runHighlighterWithAstro(lang, code);
const pre = `<pre class="${classLanguage}" data-language="${lang}"><code class="${classLanguage}">${html}</code></pre>`;
return fromHtml(pre, { fragment: true }).children[0] as HastNode;
const tree = htmlToHast(pre, { fragment: true });
return ('children' in tree ? tree.children[0] : undefined) as HastNode;

@Princesseuh Princesseuh Aug 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type Sätteri returns here is less accurate, but it's breaking now so I'll have to wait for 0.11.0 to fix it, it's this issue bruits/satteri#191

};
}

Expand Down
Loading
Loading