From: Mark Otto Date: Sun, 5 Apr 2026 23:33:19 +0000 (-0700) Subject: Prevent theme class names in Shiki snippets (#42283) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59704ca77c4eeb72247611ea7f43c83bd4d3981c;p=thirdparty%2Fbootstrap.git Prevent theme class names in Shiki snippets (#42283) * Prevent theme class names in Shiki snippets * prettier * alt: dont render at all * prettier --- diff --git a/site/astro.config.ts b/site/astro.config.ts index 4898df5a2c..1453485042 100644 --- a/site/astro.config.ts +++ b/site/astro.config.ts @@ -39,8 +39,8 @@ export default defineConfig({ syntaxHighlight: 'shiki', shikiConfig: { themes: { - light: bootstrapLight, - dark: bootstrapDark + light: { ...bootstrapLight, name: '' }, + dark: { ...bootstrapDark, name: '' } }, transformers: [ transformerNotationDiff(), @@ -48,7 +48,6 @@ export default defineConfig({ { name: 'add-language-attribute', pre(node) { - // Add data-language attribute to pre tag so Code component can access it const lang = this.options.lang if (lang) { node.properties['dataLanguage'] = lang diff --git a/site/src/libs/highlight.ts b/site/src/libs/highlight.ts index bb6ae009d6..c643c73ce1 100644 --- a/site/src/libs/highlight.ts +++ b/site/src/libs/highlight.ts @@ -55,8 +55,8 @@ export async function highlightCode( const highlighted = await codeToHtml(code, { lang, themes: { - light: bootstrapLight as any, - dark: bootstrapDark as any + light: { ...(bootstrapLight as any), name: '' }, + dark: { ...(bootstrapDark as any), name: '' } }, transformers })