Restrict remark/rehype plugins usage#3274
Conversation
Co-authored-by: Sgal Cheung <zhangsigao@live.com>
🦋 Changeset detectedLatest commit: e06cd2f 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. |
.changeset/unlucky-bananas-accept.md
Outdated
|
|
||
| Previously, some of Starlight’s remark and rehype plugins, most notably the plugin transforming Starlight's custom Markdown syntax for [rendering asides](https://starlight.astro.build/guides/authoring-content/#asides), were applied to all Markdown and MDX content. This included content from [individual Markdown pages](https://docs.astro.build/en/guides/markdown-content/#individual-markdown-pages) and content from [content collections](https://docs.astro.build/en/guides/content-collections/) other than the `docs` collection used by Starlight. | ||
|
|
||
| This change restricts the application of Starlight’s remark and rehype plugins to only Markdown and MDX content loaded using Starlight's [`docsLoader()`](https://starlight.astro.build/reference/configuration/#docsloader). While never intended, if you were relying on this behavior, please let us know in the dedicated `#starlight` channel in the [Astro Discord](https://astro.build/chat/) or by [opening an issue](https://github.com/withastro/starlight/issues/new?template=---01-bug-report.yml). |
There was a problem hiding this comment.
The docsLoader() link reference the new section added in #3272.
delucis
left a comment
There was a problem hiding this comment.
This looks great — thank you @HiDeoo!
One thought seeing this is whether a future refactor might be to move our Markdown plugins into some kind of “parent” plugin perhaps that can manage running checks like the file path one for all plugins. That would avoid running the checks three times per each file and avoid needing to remember to duplicate the check when adding something new.
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* main: Exclude banner content from Pagefind indexing (withastro#3276) Restrict remark/rehype plugins usage (withastro#3274) [ci] release (withastro#3307) Fix Astro i18n default locale regression (withastro#3306) i18n(de): translate `plugins.mdx` and `community-content.mdx` (withastro#3304)
Co-authored-by: Sgal Cheung <zhangsigao@live.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

Description
This PR builds on top of #3241 where I cherry-picked and co-auhored the initial fix preventing errors when using the Astro
renderMarkdown()content loader API.This PR also: