summaryrefslogtreecommitdiff
path: root/packages/markdown
diff options
context:
space:
mode:
authorGravatar Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> 2025-03-13 04:42:20 -0700
committerGravatar GitHub <noreply@github.com> 2025-03-13 11:42:20 +0000
commit42772253faaa77c1d24f601605da4dc5b5048be1 (patch)
tree34c41b9147ed438e076f9e55b89cb6011fae44fc /packages/markdown
parent3b5196ddb86d3cc5e3b4e1689be8ad050b193012 (diff)
downloadastro-@astrojs/markdown-remark@6.3.0.tar.gz
astro-@astrojs/markdown-remark@6.3.0.tar.zst
astro-@astrojs/markdown-remark@6.3.0.zip
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/markdown')
-rw-r--r--packages/markdown/remark/CHANGELOG.md66
-rw-r--r--packages/markdown/remark/package.json2
2 files changed, 67 insertions, 1 deletions
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",