Skip to content

Commit 199ff6e

Browse files
committed
fixup! chore(shiki): only send required langs to client
1 parent 4bc3636 commit 199ff6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/rehype-shiki/src/highlighter.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ const DEFAULT_THEME = {
1717
export const createHighlighter = options => {
1818
const shiki = createHighlighterCoreSync({
1919
themes: [DEFAULT_THEME],
20-
langs: [],
2120
engine: createJavaScriptRegexEngine(),
2221
...options,
2322
});
2423
const theme = options.themes?.[0] ?? DEFAULT_THEME;
24+
const langs = options.langs ?? [];
2525

2626
const getLanguageDisplayName = language => {
27-
const languageByIdOrAlias = options.langs.find(
27+
const languageByIdOrAlias = langs.find(
2828
({ name, aliases }) =>
2929
name.toLowerCase() === language.toLowerCase() ||
3030
(aliases !== undefined && aliases.includes(language.toLowerCase()))

0 commit comments

Comments
 (0)