feat: add support for Astro 6.4 and Sätteri#3923
Conversation
🦋 Changeset detectedLatest commit: ba14d55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hello! Thank you for opening your first PR to Starlight! ✨ Here’s what will happen next:
|
size-limit report 📦
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Thanks a lot 🙌 This is definitely one impressive first PR 😅
I didn't get the time to go over all the changes yet or play enough with the code, but I'm sharing some initial thoughts and questions.
On a more global level, I'm a bit confused on how to use the new processor with our docs, e.g. if I install @astrojs/markdown-satteri in our docs/ directory, and set markdown: { processor: satteri() }, I get the following error:
❯ nr dev
$ astro dev
17:33:37 [ERROR] [@astrojs/starlight] An unhandled error occurred while running the "astro:config:setup" hook
Vite module runner has been closed.
Location:
/Users/hideo/Temp/starlight/node_modules/.pnpm/vite@7.3.2_@types+node@24.12.4_jiti@2.6.1_lightningcss@1.32.0_yaml@2.8.3/node_modules/vite/dist/node/module-runner.js:1081:26
Stack trace:
at ModuleRunner.getModuleInformation (file:///Users/hideo/Temp/starlight/node_modules/.pnpm/vite@7.3.2_@types+node@24.12.4_jiti@2.6.1_lightningcss@1.32.0_yaml@2.8.3/node_modules/vite/dist/node/module-runner.js:1081:26)
at request (file:///Users/hideo/Temp/starlight/node_modules/.pnpm/vite@7.3.2_@types+node@24.12.4_jiti@2.6.1_lightningcss@1.32.0_yaml@2.8.3/node_modules/vite/dist/node/module-runner.js:1103:94)
at astro:config:setup (/Users/hideo/Temp/starlight/packages/starlight/index.ts:98:73)
at async runHookInternal (file:///Users/hideo/Temp/starlight/node_modules/.pnpm/astro@6.4.2_@types+node@24.12.4_jiti@2.6.1_lightningcss@1.32.0_rollup@4.53.3_yaml@2.8.3/node_modules/astro/dist/integrations/hooks.js:52:5)
at async createContainer (file:///Users/hideo/Temp/starlight/node_modules/.pnpm/astro@6.4.2_@types+node@24.12.4_jiti@2.6.1_lightningcss@1.32.0_rollup@4.53.3_yaml@2.8.3/node_modules/astro/dist/core/dev/container.js:21:14)
[ELIFECYCLE] Command failed with exit code 1.
One last point, if someone configures markdown: { processor: unified() }, or not configure any processor at all, I wonder if the deprecation log could be a bit annoying:
[astro] `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` are deprecated. Pass them to `unified({...})` from `@astrojs/markdown-remark` directly instead.
|
Quick status update here, Starlight's tests found an actual issue in Sätteri that I'm fixing here: bruits/satteri#68 |
| function ltrRawPre(value: string): string | null { | ||
| const openTag = value.match(rawPreOpenTag)?.[0]; | ||
| if (!openTag || /\sdir\s*=/.test(openTag)) return null; | ||
| return value.replace(openTag, () => `<pre dir="ltr"${openTag.slice(4)}`); | ||
| } |
There was a problem hiding this comment.
This is something unfortunate I didn't realize, when I did shiki highlighting in Astro for Sätteri, I figured that using toHTML (or whatever it's called) is fine (and much faster), but I didn't realize it meant plugins can't interact with the shiki HAST in other plugins. Something to fix in Astro, or tolerate for now, I guess...
HiDeoo
left a comment
There was a problem hiding this comment.
Thanks for the update 🙌 The new changes looks really great and I really like the non-duplicated tests 👏 Adding some new comments and suggestions for now and I'll continue to play around with the PR tomorrow.
Also, I can now set markdown: { processor: satteri() }, in the docs/ and I no longer get the error I mentioned in my previous review (I installed "@astrojs/markdown-satteri": "https://pkg.pr.new/@astrojs/markdown-satteri@16955?t=1780458151"). Altho, it looks code blocks are not processed by Expressive Code, or using Astro's Shiki highlighter?
Once this is fixed, I'll run our visual diff checker on all our docs pages (and same on Astro Docs) for sanity (doing it now would highlight all code blocks on every pages).
|
Just pushed 2 new changes to the PR: 1. An error is now thrown when Sätteri is used with Starlight saying that the Sätteri Markdown processor is not yet compatible with Starlight. For the reasoning behind this, we discussed with @delucis the current state and came up with the following conclusions:
2. The second change I did is remove all the logic related to Astro 6.0–6.3 support and the nwo legacy
Let me know what you all think about these changes. |
|
Sure, no worries. Will try to work on finishing the expressive code PR as soon as possible. Maybe by then I'll also have fixed a few of the rough edges this PR works around right now. As I'm currently on sick leave (one must wonder why I'm on GitHub dot com) it might take time, but hopefully there's not much work left on the currently open PR there. |

Description
This PR adds support for Astro 6.4 and the Sätteri processor introduced in that version. It does so by checking what (if any)
markdown.processoris set, and adding plugins accordingly to that.Versions earlier than 6.4 are also still supported, when
markdown.processorisn't present, Starlight pushes plugins to the now deprecated remarkPlugins / rehypePlugins options instead.This PR does not remove the hard dependency on
@astrojs/markdown-remark, it would be possible to with similar patterns as the ones done for Sätteri, but I figured that it wasn't up to me to decide that.