Repository navigation
integration: clear cached Markdown when the options change - #15
Merged
Merged
Conversation
Astro's content layer keeps rendered .md pages until its digest of the Astro config changes, and that digest skips integrations. Put a hash of the options on the Markdown processor's options, which the digest covers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13.
Cause
.mdpages once and stores the HTML, stylesheet link included, in.astro/data-store.jsonat the project root (notnode_modules/.astro, which is why clearing that did nothing).integrationsand functions, so a change to thecodeblocks()options never reached it..mdpages kept linking the stylesheet of the old options, which the dev server no longer serves..mdxpages are not stored this way, so they were fine.Fix
markdown.processor.options.starlightCodeblocks. Astro's digest covers that object, so any option change clears the store.unified()read only the keys they know, so the extra key has no other effect.test/astro.test.tschecks that the same options give the same digest and that different options give a different one.Verification
footnotesstill served.mdpages that linked the oldec.*.css(404)..mdand.mdxpages link the same served stylesheet after each change.pnpm lintandpnpm testpass.Not fixed here
astro devruns.mdpages stay stale until a full restart..astro/.🤖 Generated with Claude Code