We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 858a238 commit 99cb82eCopy full SHA for 99cb82e
packages/site-kit/src/lib/markdown/renderer.ts
@@ -861,7 +861,10 @@ async function syntax_highlight({
861
html = replace_blank_lines(html);
862
} else {
863
const highlighted = highlighter.codeToHtml(source, {
864
- lang: SHIKI_LANGUAGE_MAP[language as keyof typeof SHIKI_LANGUAGE_MAP],
+ // fallback to the passing the language as is if it doesn't exist in our map
865
+ // this ensures we get an error if we're using an unsupported language
866
+ // rather than silently not highlighting the code block as expected
867
+ lang: SHIKI_LANGUAGE_MAP[language as keyof typeof SHIKI_LANGUAGE_MAP] ?? language,
868
theme
869
});
870
0 commit comments