From 65bb4722f739c1f20e0926e1e3abdf64b66e27de Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 2 Sep 2024 20:32:50 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sarah Rainsberger --- .changeset/large-zebras-sniff.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/large-zebras-sniff.md b/.changeset/large-zebras-sniff.md index 32847a6c564a..97143b52122b 100644 --- a/.changeset/large-zebras-sniff.md +++ b/.changeset/large-zebras-sniff.md @@ -2,8 +2,8 @@ 'astro': major --- -Updates internal Shiki rehype plugin to highlight code blocks as hast (using Shiki's `codeToHast()` API). This allows a more direct markdown and MDX processing, and improves the performance when building the project. +Updates internal Shiki rehype plugin to highlight code blocks as hast (using Shiki's `codeToHast()` API). This allows a more direct Markdown and MDX processing, and improves the performance when building the project, but may cause issues with existing Shiki transformers. -However, a caveat with `codeToHast()` is that Shiki transformers' `postprocess` hook will now not run on code blocks in `.md` and `.mdx` files (also [documented in Shiki](https://shiki.style/guide/transformers#transformer-hooks)). Make sure the Shiki transformers passed to `markdown.shikiConfig.transformers` do not use the `postprocess` hook to avoid issues with the HTML output. +If you are using Shiki transformers passed to `markdown.shikiConfig.transformers`, you must make sure they do not use the `postprocess` hook as it no longer runs on code blocks in `.md` and `.mdx` files. (See [the Shiki documentation on transformer hooks](https://shiki.style/guide/transformers#transformer-hooks) for more information). -Code blocks in `.mdoc` files and `` component will still work the same and shouldn't need any changes as they do not use the internal Shiki rehype plugin. +Code blocks in `.mdoc` files and `` component do not use the internal Shiki rehype plugin and are unaffected.