summaryrefslogtreecommitdiff
path: root/packages/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown')
-rw-r--r--packages/markdown/remark/CHANGELOG.md34
-rw-r--r--packages/markdown/remark/package.json2
2 files changed, 35 insertions, 1 deletions
diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md
index 73bab0b25..1563450b4 100644
--- a/packages/markdown/remark/CHANGELOG.md
+++ b/packages/markdown/remark/CHANGELOG.md
@@ -1,5 +1,39 @@
# @astrojs/markdown-remark
+## 5.3.0
+
+### Minor Changes
+
+- [#12039](https://github.com/withastro/astro/pull/12039) [`710a1a1`](https://github.com/withastro/astro/commit/710a1a11f488ff6ed3da6d3e0723b2322ccfe27b) Thanks [@ematipico](https://github.com/ematipico)! - Adds a `markdown.shikiConfig.langAlias` option that allows [aliasing a non-supported code language to a known language](https://shiki.style/guide/load-lang#custom-language-aliases). This is useful when the language of your code samples is not [a built-in Shiki language](https://shiki.style/languages), but you want your Markdown source to contain an accurate language while also displaying syntax highlighting.
+
+ The following example configures Shiki to highlight `cjs` code blocks using the `javascript` syntax highlighter:
+
+ ```js
+ import { defineConfig } from 'astro/config';
+
+ export default defineConfig({
+ markdown: {
+ shikiConfig: {
+ langAlias: {
+ cjs: 'javascript',
+ },
+ },
+ },
+ });
+ ```
+
+ Then in your Markdown, you can use the alias as the language for a code block for syntax highlighting:
+
+ ````md
+ ```cjs
+ 'use strict';
+
+ function commonJs() {
+ return 'I am a commonjs file';
+ }
+ ```
+ ````
+
## 5.2.0
### Minor Changes
diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json
index cf3482b96..ed41000ce 100644
--- a/packages/markdown/remark/package.json
+++ b/packages/markdown/remark/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/markdown-remark",
- "version": "5.2.0",
+ "version": "5.3.0",
"type": "module",
"author": "withastro",
"license": "MIT",