Skip to content

fix: remove is:raw from rehype-prism plugin#15297

Merged
florian-lefebvre merged 5 commits into
withastro:mainfrom
rururux:md-prism-israw
Feb 4, 2026
Merged

fix: remove is:raw from rehype-prism plugin#15297
florian-lefebvre merged 5 commits into
withastro:mainfrom
rururux:md-prism-israw

Conversation

@rururux
Copy link
Copy Markdown
Member

@rururux rururux commented Jan 25, 2026

fixes: #13400

Changes

I removed the is:raw attribute from the code generated by the rehype-prism plugin.
Summary of Comment: #13400 (comment)

  • The is:raw attribute is handled within @astrojs/compiler.

  • @astrojs/compiler is used within astroVitePlugin.

  • Subsequent plugins do not use @astrojs/compiler. (Search results for the compile function using transform imported from @astrojs/compiler)

  • The markdownVitePlugin, which uses the rehype-prism plugin, is configured after astroVitePlugin.

  • Consequently, this causes the is:raw attribute added by markdownVitePlugin to remain unchanged until the end.

astroLoadFallbackPlugin({ fs, root: settings.config.root }),
astroVitePlugin({ settings, logger }),
astroScriptsPlugin({ settings }),
// The server plugin is for dev only and having it run during the build causes
// the build to run very slow as the filewatcher is triggered often.
command === 'dev' && vitePluginAstroServer({ settings, logger, fs, routesList, manifest }), // manifest is only required in dev mode, where it gets created before a Vite instance is created, and get passed to this function
importMetaEnv({ envLoader }),
astroEnv({ settings, sync, envLoader }),
vitePluginAdapterConfig(settings),
markdownVitePlugin({ settings, logger }),
htmlVitePlugin(),

Testing

I added a test to verify that the is:raw attribute is not included in the post-build code.

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 25, 2026

🦋 Changeset detected

Latest commit: 8434141

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions Bot added the feat: markdown Related to Markdown (scope) label Jan 25, 2026
@rururux rururux marked this pull request as draft January 30, 2026 15:24
@rururux rururux changed the base branch from main to next January 30, 2026 15:25
@rururux rururux marked this pull request as ready for review January 30, 2026 15:27
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Package Trust Level Decreased

Caution

Decreased trust levels may indicate a higher risk of supply chain attacks. Please review these changes carefully.

📦 Package 🔒 Before 🔓 After
eslint-plugin-regexp trusted-with-provenance none
@cloudflare/kv-asset-handler trusted-with-provenance none
@cloudflare/unenv-preset trusted-with-provenance none
workerd trusted-with-provenance none
@sveltejs/vite-plugin-svelte-inspector trusted-with-provenance provenance
@sveltejs/vite-plugin-svelte trusted-with-provenance provenance
jsdoc-type-pratt-parser trusted-with-provenance none
miniflare trusted-with-provenance none
youch provenance none
@cloudflare/workerd-darwin-64 trusted-with-provenance none
@cloudflare/workerd-darwin-arm64 trusted-with-provenance none
@cloudflare/workerd-linux-64 trusted-with-provenance none
@cloudflare/workerd-linux-arm64 trusted-with-provenance none
@cloudflare/workerd-windows-64 trusted-with-provenance none
wrangler trusted-with-provenance none

@matthewp matthewp deleted the branch withastro:main January 30, 2026 17:31
@matthewp matthewp closed this Jan 30, 2026
@matthewp
Copy link
Copy Markdown
Contributor

sorry about the close.

@matthewp matthewp reopened this Jan 30, 2026
@rururux rururux changed the base branch from next to main January 30, 2026 17:47
@rururux
Copy link
Copy Markdown
Member Author

rururux commented Jan 30, 2026

No problem at all! Thanks for re-opening it.

Comment thread .changeset/flat-symbols-arrive.md Outdated
rururux and others added 2 commits February 4, 2026 22:24
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
@rururux
Copy link
Copy Markdown
Member Author

rururux commented Feb 4, 2026

Thank you for reviewing and approving! ☺️

@florian-lefebvre florian-lefebvre merged commit 80f0225 into withastro:main Feb 4, 2026
21 of 22 checks passed
@rururux
Copy link
Copy Markdown
Member Author

rururux commented Feb 6, 2026

and thank you for merging! 😄

@rururux rururux deleted the md-prism-israw branch February 6, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: markdown Related to Markdown (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prism syntax highlighting adding is:raw in generated HTML

3 participants