@astrojs/markdown-remark@5.3.0
·
2782 commits
to main
since this release
Minor Changes
-
#12039
710a1a1
Thanks @ematipico! - Adds amarkdown.shikiConfig.langAlias
option that allows aliasing a non-supported code language to a known language. This is useful when the language of your code samples is not a built-in Shiki language, 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 thejavascript
syntax highlighter: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:
```cjs 'use strict'; function commonJs() { return 'I am a commonjs file'; } ```