🍿 Minor Changes
-
#12039
710a1a1Thanks @ematipico! - Adds amarkdown.shikiConfig.langAliasoption 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
cjscode blocks using thejavascriptsyntax 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';}```