Replies: 2 comments
-
Seems like an ok addition to me 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
-
This will be shipped in Astro v4.16 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Support Shiki's
langAlias
option in markdown configuration so we can register custom language aliases for the code blocks.Background & Motivation
In our website we have some code blocks that are tagged with
cjs
, because they contain code that hascjs
-specific syntax like"use strict"
,module.exports
, .etc. However Shiki doesn't support syntax highlighting forcjs
blocks out of box and will fallback to usetxt
:Astro provides the
langs
option to register custom languages, but that also means we have to double load thejs
grammar for thecjs
language like we did in biomejs/website#609 which is not very elegant.On the other hand, there is a
langAlias
option in Shiki that allows registering aliases for a language, but it is not exposed from Astro.Goals
Support
langAlias
option in markdown configuration.Example
Beta Was this translation helpful? Give feedback.
All reactions