diff options
author | 2025-03-13 04:42:20 -0700 | |
---|---|---|
committer | 2025-03-13 11:42:20 +0000 | |
commit | 42772253faaa77c1d24f601605da4dc5b5048be1 (patch) | |
tree | 34c41b9147ed438e076f9e55b89cb6011fae44fc | |
parent | 3b5196ddb86d3cc5e3b4e1689be8ad050b193012 (diff) | |
download | astro@5.5.0.tar.gz astro@5.5.0.tar.zst astro@5.5.0.zip |
[ci] release (#13397)astro@5.5.0@astrojs/mdx@4.2.0@astrojs/markdown-remark@6.3.0@astrojs/markdoc@0.13.0
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
41 files changed, 363 insertions, 212 deletions
diff --git a/.changeset/cold-rats-swim.md b/.changeset/cold-rats-swim.md deleted file mode 100644 index 62b428712..000000000 --- a/.changeset/cold-rats-swim.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -'astro': minor ---- - -Adds a new experimental flag called `experimental.preserveScriptOrder` that renders `<script>` and `<style>` tags in the same order as they are defined. - -When rendering multiple `<style>` and `<script>` tags on the same page, Astro currently reverses their order in your generated HTML output. This can give unexpected results, for example CSS styles being overridden by earlier defined style tags when your site is built. - -With the new `preserveScriptOrder` flag enabled, Astro will generate the styles in the order they are defined: - -```js title="astro.config.mjs" -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - experimental: { - preserveScriptOrder: true, - }, -}); -``` -For example, the following component has two `<style>` tags, and both define the same style for the `body` tag: - -```html -<p>I am a component</p> -<style> - body { - background: red; - } -</style> -<style> - body { - background: yellow; - } -</style> -``` - -Once the project is compiled, Astro will create an inline style where `yellow` appears first, and then `red`. Ultimately, the `red` background is applied: - -```css -body {background:#ff0} body {background:red} -``` - -When `experimental.preserveScriptOrder` is set to `true`, the order of the two styles is kept as it is, and in the style generated `red` appears first, and then `yellow`: - -```css -body {background:red} body {background:#ff0} -``` - -This is a breaking change to how Astro renders project code that contains multiple `<style>` and `<script>` tags in the same component. If you were previously compensating for Astro's behavior by writing these out of order, you will need to update your code. - -This will eventually become the new default Astro behavior, so we encourage you to add this experimental style and script ordering as soon as you are able! This will help us test the new behavior and ensure your code is ready when this becomes the new normal. - -For more information as this feature develops, please see the [experimental script order docs](https://docs.astro.build/en/reference/experimental-flags/preserve-script-order/). diff --git a/.changeset/good-toys-refuse.md b/.changeset/good-toys-refuse.md deleted file mode 100644 index 2705bcfa8..000000000 --- a/.changeset/good-toys-refuse.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -'@astrojs/markdoc': minor -'@astrojs/mdx': minor -'@astrojs/markdown-remark': minor -'astro': minor ---- - -Adds support for a new `experimental.headingIdCompat` flag - -By default, Astro removes a trailing `-` from the end of IDs it generates for headings ending with -special characters. This differs from the behavior of common Markdown processors. - -You can now disable this behavior with a new configuration flag: - -```js -// astro.config.mjs -import { defineConfig } from "astro/config"; - -export default defineConfig({ - experimental: { - headingIdCompat: true, - }, -}); -``` - -This can be useful when heading IDs and anchor links need to behave consistently across your site -and other platforms such as GitHub and npm. - -If you are [using the `rehypeHeadingIds` plugin directly](https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins), you can also pass this new option: - -```js -// astro.config.mjs -import { defineConfig } from 'astro/config'; -import { rehypeHeadingIds } from '@astrojs/markdown-remark'; -import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source'; - -export default defineConfig({ - markdown: { - rehypePlugins: [ - [rehypeHeadingIds, { experimentalHeadingIdCompat: true }], - otherPluginThatReliesOnHeadingIDs, - ], - }, -}); -``` diff --git a/.changeset/hot-games-doubt.md b/.changeset/hot-games-doubt.md deleted file mode 100644 index 8ed8005b1..000000000 --- a/.changeset/hot-games-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes a bug in error handling that saving a content file with a schema error would display an "unhandled rejection" error instead of the correct schema error diff --git a/.changeset/large-dolphins-roll.md b/.changeset/large-dolphins-roll.md deleted file mode 100644 index 5f78e57c5..000000000 --- a/.changeset/large-dolphins-roll.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -'@astrojs/markdown-remark': minor -'astro': minor ---- - -Adds a new configuration option for Markdown syntax highlighting `excludeLangs` - -This option provides better support for diagramming tools that rely on Markdown code blocks, such as Mermaid.js and D2 by allowing you to exclude specific languages from Astro's default syntax highlighting. - -This option allows you to avoid rendering conflicts with tools that depend on the code not being highlighted without forcing you to disable syntax highlighting for other code blocks. - -The following example configuration will exclude highlighting for `mermaid` and `math` code blocks: - -```js -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - markdown: { - syntaxHighlight: { - type: 'shiki', - excludeLangs: ['mermaid', 'math'], - }, - }, -}); -``` - -Read more about this new option in the [Markdown syntax highlighting configuration docs](https://docs.astro.build/en/reference/configuration-reference/#markdownsyntaxhighlight). diff --git a/.changeset/lazy-kings-rush.md b/.changeset/lazy-kings-rush.md deleted file mode 100644 index e3eecd832..000000000 --- a/.changeset/lazy-kings-rush.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an edge case where the client router executed scripts twice when used with a custom swap function that only swaps parts of the DOM. diff --git a/.changeset/ripe-fans-push.md b/.changeset/ripe-fans-push.md deleted file mode 100644 index a4386ee35..000000000 --- a/.changeset/ripe-fans-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Updates `primsjs` to version 1.30.0, which adds support for more languages and fixes a security advisory which does not affect Astro. diff --git a/.changeset/rude-maps-visit.md b/.changeset/rude-maps-visit.md deleted file mode 100644 index 653c0d38a..000000000 --- a/.changeset/rude-maps-visit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes the documentation of the i18n configuration where `manual` was presented as a key of `routing` instead of an available value. diff --git a/.changeset/slow-kings-wave.md b/.changeset/slow-kings-wave.md deleted file mode 100644 index 69d186fa9..000000000 --- a/.changeset/slow-kings-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an issue where astro:page-load fires before all scripts are executed diff --git a/.changeset/small-masks-wink.md b/.changeset/small-masks-wink.md deleted file mode 100644 index b6ed1736e..000000000 --- a/.changeset/small-masks-wink.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Displays correct error message when sharp isn't installed diff --git a/examples/basics/package.json b/examples/basics/package.json index a97b14fc4..1f9987832 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 8d4876838..88b635be2 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^4.1.1", + "@astrojs/mdx": "^4.2.0", "@astrojs/rss": "^4.0.11", "@astrojs/sitemap": "^3.2.1", - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/component/package.json b/examples/component/package.json index 0891e6309..44ffa8c90 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^5.4.3" + "astro": "^5.5.0" }, "peerDependencies": { "astro": "^4.0.0 || ^5.0.0" diff --git a/examples/container-with-vitest/package.json b/examples/container-with-vitest/package.json index 4818b8d17..269d091ae 100644 --- a/examples/container-with-vitest/package.json +++ b/examples/container-with-vitest/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/react": "^4.2.1", - "astro": "^5.4.3", + "astro": "^5.5.0", "react": "^18.3.1", "react-dom": "^18.3.1", "vitest": "^3.0.8" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 8552ac002..d47ccafa6 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -13,6 +13,6 @@ "@astrojs/alpinejs": "^0.4.3", "@types/alpinejs": "^3.13.11", "alpinejs": "^3.14.8", - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 7f0a24de4..b613ecf3c 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -17,7 +17,7 @@ "@astrojs/vue": "^5.0.7", "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", - "astro": "^5.4.3", + "astro": "^5.5.0", "preact": "^10.26.4", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index d53b117e3..69578e6e6 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -12,7 +12,7 @@ "dependencies": { "@astrojs/preact": "^4.0.5", "@preact/signals": "^2.0.1", - "astro": "^5.4.3", + "astro": "^5.5.0", "preact": "^10.26.4" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 1f31fc21e..448976a98 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -13,7 +13,7 @@ "@astrojs/react": "^4.2.1", "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", - "astro": "^5.4.3", + "astro": "^5.5.0", "react": "^18.3.1", "react-dom": "^18.3.1" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 4a7ea82da..32ecace48 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@astrojs/solid-js": "^5.0.5", - "astro": "^5.4.3", + "astro": "^5.5.0", "solid-js": "^1.9.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 58ab2ade1..27c4edcd6 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@astrojs/svelte": "^7.0.6", - "astro": "^5.4.3", + "astro": "^5.5.0", "svelte": "^5.22.6" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 4d6e926a8..1d651913b 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@astrojs/vue": "^5.0.7", - "astro": "^5.4.3", + "astro": "^5.5.0", "vue": "^3.5.13" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 00954607a..e2f704e2f 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -11,6 +11,6 @@ }, "dependencies": { "@astrojs/node": "^9.1.3", - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 4353dae6a..15d6751ce 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^5.4.3" + "astro": "^5.5.0" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 196f21a5f..51b1f6f45 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 44a39313b..08a00db35 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 2964d01b8..709c680a7 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/node": "^9.1.3", "@astrojs/svelte": "^7.0.6", - "astro": "^5.4.3", + "astro": "^5.5.0", "svelte": "^5.22.6" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index 6051ad53f..d780e8488 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -9,7 +9,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^5.4.3", + "astro": "^5.5.0", "sass": "^1.85.1", "sharp": "^0.33.3" } diff --git a/examples/toolbar-app/package.json b/examples/toolbar-app/package.json index 942e14684..09a7f8aaf 100644 --- a/examples/toolbar-app/package.json +++ b/examples/toolbar-app/package.json @@ -16,6 +16,6 @@ }, "devDependencies": { "@types/node": "^18.17.8", - "astro": "^5.4.3" + "astro": "^5.5.0" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 9fc42734c..835575331 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdoc": "^0.12.11", - "astro": "^5.4.3" + "@astrojs/markdoc": "^0.13.0", + "astro": "^5.5.0" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index ab45df6c8..daca3e8c4 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^4.1.1", + "@astrojs/mdx": "^4.2.0", "@astrojs/preact": "^4.0.5", - "astro": "^5.4.3", + "astro": "^5.5.0", "preact": "^10.26.4" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 30643ff9f..1b4c26d88 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -12,7 +12,7 @@ "dependencies": { "@astrojs/preact": "^4.0.5", "@nanostores/preact": "^0.5.2", - "astro": "^5.4.3", + "astro": "^5.5.0", "nanostores": "^0.11.4", "preact": "^10.26.4" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index b3bd6f219..6d032c389 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -10,10 +10,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^4.1.1", + "@astrojs/mdx": "^4.2.0", "@tailwindcss/vite": "^4.0.12", "@types/canvas-confetti": "^1.9.0", - "astro": "^5.4.3", + "astro": "^5.5.0", "canvas-confetti": "^1.9.3", "tailwindcss": "^4.0.12" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 932953815..fe969c4d2 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -11,7 +11,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^5.4.3", + "astro": "^5.5.0", "vitest": "^3.0.8" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 25bbdcb5c..2de120379 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,148 @@ # astro +## 5.5.0 + +### Minor Changes + +- [#13402](https://github.com/withastro/astro/pull/13402) [`3e7b498`](https://github.com/withastro/astro/commit/3e7b498dce52648484bb4deb04bf9e960c3d08e3) Thanks [@ematipico](https://github.com/ematipico)! - Adds a new experimental flag called `experimental.preserveScriptOrder` that renders `<script>` and `<style>` tags in the same order as they are defined. + + When rendering multiple `<style>` and `<script>` tags on the same page, Astro currently reverses their order in your generated HTML output. This can give unexpected results, for example CSS styles being overridden by earlier defined style tags when your site is built. + + With the new `preserveScriptOrder` flag enabled, Astro will generate the styles in the order they are defined: + + ```js title="astro.config.mjs" + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + preserveScriptOrder: true, + }, + }); + ``` + + For example, the following component has two `<style>` tags, and both define the same style for the `body` tag: + + ```html + <p>I am a component</p> + <style> + body { + background: red; + } + </style> + <style> + body { + background: yellow; + } + </style> + ``` + + Once the project is compiled, Astro will create an inline style where `yellow` appears first, and then `red`. Ultimately, the `red` background is applied: + + ```css + body { + background: #ff0; + } + body { + background: red; + } + ``` + + When `experimental.preserveScriptOrder` is set to `true`, the order of the two styles is kept as it is, and in the style generated `red` appears first, and then `yellow`: + + ```css + body { + background: red; + } + body { + background: #ff0; + } + ``` + + This is a breaking change to how Astro renders project code that contains multiple `<style>` and `<script>` tags in the same component. If you were previously compensating for Astro's behavior by writing these out of order, you will need to update your code. + + This will eventually become the new default Astro behavior, so we encourage you to add this experimental style and script ordering as soon as you are able! This will help us test the new behavior and ensure your code is ready when this becomes the new normal. + + For more information as this feature develops, please see the [experimental script order docs](https://docs.astro.build/en/reference/experimental-flags/preserve-script-order/). + +- [#13352](https://github.com/withastro/astro/pull/13352) [`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7) Thanks [@delucis](https://github.com/delucis)! - Adds support for a new `experimental.headingIdCompat` flag + + By default, Astro removes a trailing `-` from the end of IDs it generates for headings ending with + special characters. This differs from the behavior of common Markdown processors. + + You can now disable this behavior with a new configuration flag: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + headingIdCompat: true, + }, + }); + ``` + + This can be useful when heading IDs and anchor links need to behave consistently across your site + and other platforms such as GitHub and npm. + + If you are [using the `rehypeHeadingIds` plugin directly](https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins), you can also pass this new option: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import { rehypeHeadingIds } from '@astrojs/markdown-remark'; + import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source'; + + export default defineConfig({ + markdown: { + rehypePlugins: [ + [rehypeHeadingIds, { experimentalHeadingIdCompat: true }], + otherPluginThatReliesOnHeadingIDs, + ], + }, + }); + ``` + +- [#13311](https://github.com/withastro/astro/pull/13311) [`a3327ff`](https://github.com/withastro/astro/commit/a3327ffbe6373228339824684eaa6f340a20a32e) Thanks [@chrisirhc](https://github.com/chrisirhc)! - Adds a new configuration option for Markdown syntax highlighting `excludeLangs` + + This option provides better support for diagramming tools that rely on Markdown code blocks, such as Mermaid.js and D2 by allowing you to exclude specific languages from Astro's default syntax highlighting. + + This option allows you to avoid rendering conflicts with tools that depend on the code not being highlighted without forcing you to disable syntax highlighting for other code blocks. + + The following example configuration will exclude highlighting for `mermaid` and `math` code blocks: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + markdown: { + syntaxHighlight: { + type: 'shiki', + excludeLangs: ['mermaid', 'math'], + }, + }, + }); + ``` + + Read more about this new option in the [Markdown syntax highlighting configuration docs](https://docs.astro.build/en/reference/configuration-reference/#markdownsyntaxhighlight). + +### Patch Changes + +- [#13404](https://github.com/withastro/astro/pull/13404) [`4e78b4d`](https://github.com/withastro/astro/commit/4e78b4d10d2214c94752a1fef74db325053cf071) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug in error handling that saving a content file with a schema error would display an "unhandled rejection" error instead of the correct schema error + +- [#13379](https://github.com/withastro/astro/pull/13379) [`d59eb22`](https://github.com/withastro/astro/commit/d59eb227334b788289533bac41f015b498179a2f) Thanks [@martrapp](https://github.com/martrapp)! - Fixes an edge case where the client router executed scripts twice when used with a custom swap function that only swaps parts of the DOM. + +- [#13393](https://github.com/withastro/astro/pull/13393) [`6b8fdb8`](https://github.com/withastro/astro/commit/6b8fdb8a113b6f76448b41beb990c33fafb09b3e) Thanks [@renovate](https://github.com/apps/renovate)! - Updates `primsjs` to version 1.30.0, which adds support for more languages and fixes a security advisory which does not affect Astro. + +- [#13374](https://github.com/withastro/astro/pull/13374) [`7b75bc5`](https://github.com/withastro/astro/commit/7b75bc5c36bc338bcef5ef41502e87c184c117ec) Thanks [@ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes the documentation of the i18n configuration where `manual` was presented as a key of `routing` instead of an available value. + +- [#13380](https://github.com/withastro/astro/pull/13380) [`9bfa6e6`](https://github.com/withastro/astro/commit/9bfa6e6d8b95424436be405a80d5df3f2e2e72df) Thanks [@martrapp](https://github.com/martrapp)! - Fixes an issue where astro:page-load fires before all scripts are executed + +- [#13407](https://github.com/withastro/astro/pull/13407) [`0efdc22`](https://github.com/withastro/astro/commit/0efdc22b182f6cec4155a972f0dde1da686c5453) Thanks [@ascorbic](https://github.com/ascorbic)! - Displays correct error message when sharp isn't installed + +- Updated dependencies [[`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7), [`a3327ff`](https://github.com/withastro/astro/commit/a3327ffbe6373228339824684eaa6f340a20a32e)]: + - @astrojs/markdown-remark@6.3.0 + ## 5.4.3 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 4a0470142..674381417 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "5.4.3", + "version": "5.5.0", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/integrations/markdoc/CHANGELOG.md b/packages/integrations/markdoc/CHANGELOG.md index a95521fa0..b38ec4b6c 100644 --- a/packages/integrations/markdoc/CHANGELOG.md +++ b/packages/integrations/markdoc/CHANGELOG.md @@ -1,5 +1,53 @@ # @astrojs/markdoc +## 0.13.0 + +### Minor Changes + +- [#13352](https://github.com/withastro/astro/pull/13352) [`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7) Thanks [@delucis](https://github.com/delucis)! - Adds support for a new `experimental.headingIdCompat` flag + + By default, Astro removes a trailing `-` from the end of IDs it generates for headings ending with + special characters. This differs from the behavior of common Markdown processors. + + You can now disable this behavior with a new configuration flag: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + headingIdCompat: true, + }, + }); + ``` + + This can be useful when heading IDs and anchor links need to behave consistently across your site + and other platforms such as GitHub and npm. + + If you are [using the `rehypeHeadingIds` plugin directly](https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins), you can also pass this new option: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import { rehypeHeadingIds } from '@astrojs/markdown-remark'; + import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source'; + + export default defineConfig({ + markdown: { + rehypePlugins: [ + [rehypeHeadingIds, { experimentalHeadingIdCompat: true }], + otherPluginThatReliesOnHeadingIDs, + ], + }, + }); + ``` + +### Patch Changes + +- Updated dependencies [[`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7), [`a3327ff`](https://github.com/withastro/astro/commit/a3327ffbe6373228339824684eaa6f340a20a32e)]: + - @astrojs/markdown-remark@6.3.0 + ## 0.12.11 ### Patch Changes diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index ef571284c..ce858e90a 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/markdoc", "description": "Add support for Markdoc in your Astro site", - "version": "0.12.11", + "version": "0.13.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index 483162a4e..a7cedf055 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,53 @@ # @astrojs/mdx +## 4.2.0 + +### Minor Changes + +- [#13352](https://github.com/withastro/astro/pull/13352) [`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7) Thanks [@delucis](https://github.com/delucis)! - Adds support for a new `experimental.headingIdCompat` flag + + By default, Astro removes a trailing `-` from the end of IDs it generates for headings ending with + special characters. This differs from the behavior of common Markdown processors. + + You can now disable this behavior with a new configuration flag: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + headingIdCompat: true, + }, + }); + ``` + + This can be useful when heading IDs and anchor links need to behave consistently across your site + and other platforms such as GitHub and npm. + + If you are [using the `rehypeHeadingIds` plugin directly](https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins), you can also pass this new option: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import { rehypeHeadingIds } from '@astrojs/markdown-remark'; + import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source'; + + export default defineConfig({ + markdown: { + rehypePlugins: [ + [rehypeHeadingIds, { experimentalHeadingIdCompat: true }], + otherPluginThatReliesOnHeadingIDs, + ], + }, + }); + ``` + +### Patch Changes + +- Updated dependencies [[`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7), [`a3327ff`](https://github.com/withastro/astro/commit/a3327ffbe6373228339824684eaa6f340a20a32e)]: + - @astrojs/markdown-remark@6.3.0 + ## 4.1.1 ### Patch Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 6105b2e4d..b6363172c 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Add support for MDX pages in your Astro site", - "version": "4.1.1", + "version": "4.2.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md index 0276c323c..79871a4e7 100644 --- a/packages/markdown/remark/CHANGELOG.md +++ b/packages/markdown/remark/CHANGELOG.md @@ -1,5 +1,71 @@ # @astrojs/markdown-remark +## 6.3.0 + +### Minor Changes + +- [#13352](https://github.com/withastro/astro/pull/13352) [`cb886dc`](https://github.com/withastro/astro/commit/cb886dcde6c28acca286a66be46228a4d4cc52e7) Thanks [@delucis](https://github.com/delucis)! - Adds support for a new `experimental.headingIdCompat` flag + + By default, Astro removes a trailing `-` from the end of IDs it generates for headings ending with + special characters. This differs from the behavior of common Markdown processors. + + You can now disable this behavior with a new configuration flag: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + headingIdCompat: true, + }, + }); + ``` + + This can be useful when heading IDs and anchor links need to behave consistently across your site + and other platforms such as GitHub and npm. + + If you are [using the `rehypeHeadingIds` plugin directly](https://docs.astro.build/en/guides/markdown-content/#heading-ids-and-plugins), you can also pass this new option: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import { rehypeHeadingIds } from '@astrojs/markdown-remark'; + import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source'; + + export default defineConfig({ + markdown: { + rehypePlugins: [ + [rehypeHeadingIds, { experimentalHeadingIdCompat: true }], + otherPluginThatReliesOnHeadingIDs, + ], + }, + }); + ``` + +- [#13311](https://github.com/withastro/astro/pull/13311) [`a3327ff`](https://github.com/withastro/astro/commit/a3327ffbe6373228339824684eaa6f340a20a32e) Thanks [@chrisirhc](https://github.com/chrisirhc)! - Adds a new configuration option for Markdown syntax highlighting `excludeLangs` + + This option provides better support for diagramming tools that rely on Markdown code blocks, such as Mermaid.js and D2 by allowing you to exclude specific languages from Astro's default syntax highlighting. + + This option allows you to avoid rendering conflicts with tools that depend on the code not being highlighted without forcing you to disable syntax highlighting for other code blocks. + + The following example configuration will exclude highlighting for `mermaid` and `math` code blocks: + + ```js + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + markdown: { + syntaxHighlight: { + type: 'shiki', + excludeLangs: ['mermaid', 'math'], + }, + }, + }); + ``` + + Read more about this new option in the [Markdown syntax highlighting configuration docs](https://docs.astro.build/en/reference/configuration-reference/#markdownsyntaxhighlight). + ## 6.2.1 ### Patch Changes diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 90788b5c7..cd7b50e51 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/markdown-remark", - "version": "6.2.1", + "version": "6.3.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36a7f6d6a..60c234019 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,13 +142,13 @@ importers: examples/basics: dependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/blog: dependencies: '@astrojs/mdx': - specifier: ^4.1.1 + specifier: ^4.2.0 version: link:../../packages/integrations/mdx '@astrojs/rss': specifier: ^4.0.11 @@ -157,13 +157,13 @@ importers: specifier: ^3.2.1 version: link:../../packages/integrations/sitemap astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/container-with-vitest: @@ -172,7 +172,7 @@ importers: specifier: ^4.2.1 version: link:../../packages/integrations/react astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro react: specifier: ^18.3.1 @@ -203,7 +203,7 @@ importers: specifier: ^3.14.8 version: 3.14.8 astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/framework-multiple: @@ -230,7 +230,7 @@ importers: specifier: ^18.3.5 version: 18.3.5(@types/react@18.3.18) astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro preact: specifier: ^10.26.4 @@ -260,7 +260,7 @@ importers: specifier: ^2.0.1 version: 2.0.1(preact@10.26.4) astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro preact: specifier: ^10.26.4 @@ -278,7 +278,7 @@ importers: specifier: ^18.3.5 version: 18.3.5(@types/react@18.3.18) astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro react: specifier: ^18.3.1 @@ -293,7 +293,7 @@ importers: specifier: ^5.0.5 version: link:../../packages/integrations/solid astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro solid-js: specifier: ^1.9.5 @@ -305,7 +305,7 @@ importers: specifier: ^7.0.6 version: link:../../packages/integrations/svelte astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro svelte: specifier: ^5.22.6 @@ -317,7 +317,7 @@ importers: specifier: ^5.0.7 version: link:../../packages/integrations/vue astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro vue: specifier: ^3.5.13 @@ -329,25 +329,25 @@ importers: specifier: ^9.1.3 version: link:../../packages/integrations/node astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/minimal: dependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/ssr: @@ -359,7 +359,7 @@ importers: specifier: ^7.0.6 version: link:../../packages/integrations/svelte astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro svelte: specifier: ^5.22.6 @@ -368,7 +368,7 @@ importers: examples/starlog: dependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro sass: specifier: ^1.85.1 @@ -383,28 +383,28 @@ importers: specifier: ^18.17.8 version: 18.19.50 astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/with-markdoc: dependencies: '@astrojs/markdoc': - specifier: ^0.12.11 + specifier: ^0.13.0 version: link:../../packages/integrations/markdoc astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro examples/with-mdx: dependencies: '@astrojs/mdx': - specifier: ^4.1.1 + specifier: ^4.2.0 version: link:../../packages/integrations/mdx '@astrojs/preact': specifier: ^4.0.5 version: link:../../packages/integrations/preact astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro preact: specifier: ^10.26.4 @@ -419,7 +419,7 @@ importers: specifier: ^0.5.2 version: 0.5.2(nanostores@0.11.4)(preact@10.26.4) astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro nanostores: specifier: ^0.11.4 @@ -431,7 +431,7 @@ importers: examples/with-tailwindcss: dependencies: '@astrojs/mdx': - specifier: ^4.1.1 + specifier: ^4.2.0 version: link:../../packages/integrations/mdx '@tailwindcss/vite': specifier: ^4.0.12 @@ -440,7 +440,7 @@ importers: specifier: ^1.9.0 version: 1.9.0 astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro canvas-confetti: specifier: ^1.9.3 @@ -452,7 +452,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^5.4.3 + specifier: ^5.5.0 version: link:../../packages/astro vitest: specifier: ^3.0.8 |