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 4bc3636 commit 199ff6eCopy full SHA for 199ff6e
packages/rehype-shiki/src/highlighter.mjs
@@ -17,14 +17,14 @@ const DEFAULT_THEME = {
17
export const createHighlighter = options => {
18
const shiki = createHighlighterCoreSync({
19
themes: [DEFAULT_THEME],
20
- langs: [],
21
engine: createJavaScriptRegexEngine(),
22
...options,
23
});
24
const theme = options.themes?.[0] ?? DEFAULT_THEME;
+ const langs = options.langs ?? [];
25
26
const getLanguageDisplayName = language => {
27
- const languageByIdOrAlias = options.langs.find(
+ const languageByIdOrAlias = langs.find(
28
({ name, aliases }) =>
29
name.toLowerCase() === language.toLowerCase() ||
30
(aliases !== undefined && aliases.includes(language.toLowerCase()))
0 commit comments