diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/astro/components/Code.astro | 3 | ||||
-rw-r--r-- | packages/astro/components/Shiki.js | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/astro/components/Code.astro b/packages/astro/components/Code.astro index 5066b9594..7996e1b53 100644 --- a/packages/astro/components/Code.astro +++ b/packages/astro/components/Code.astro @@ -57,8 +57,7 @@ const highlighter = await getHighlighter({ langs: typeof lang !== 'string' ? [lang] : undefined, }); const _html = highlighter.codeToHtml(code, { - lang: typeof lang === 'string' ? lang : lang.id, - theme, + lang: typeof lang === 'string' ? lang : lang.id }); const html = repairShikiTheme(_html); --- diff --git a/packages/astro/components/Shiki.js b/packages/astro/components/Shiki.js index 79d61d102..8e32f5f74 100644 --- a/packages/astro/components/Shiki.js +++ b/packages/astro/components/Shiki.js @@ -19,10 +19,13 @@ function stringify(opts) { */ async function resolveHighlighter(opts) { const resolvedThemes = []; - if (opts.theme && opts.theme in themes) { + if (Object.keys(opts.theme).length) { + resolvedThemes.push(opts.theme); + } else if (opts.theme && opts.theme in themes) { resolvedThemes.push(await themes[opts.theme]()); } + let resolvedLanguages; if (opts.langs) { resolvedLanguages = opts.langs; |