@@ -5,25 +5,6 @@ import type * as shikiTypes from 'shiki';
55import { getHighlighter } from 'shiki' ;
66import type { AstroMarkdocConfig } from '../config.js' ;
77
8- // Map of old theme names to new names to preserve compatibility when we upgrade shiki
9- const compatThemes : Record < string , string > = {
10- 'material-darker' : 'material-theme-darker' ,
11- 'material-default' : 'material-theme' ,
12- 'material-lighter' : 'material-theme-lighter' ,
13- 'material-ocean' : 'material-theme-ocean' ,
14- 'material-palenight' : 'material-theme-palenight' ,
15- } ;
16-
17- const normalizeTheme = ( theme : string | shikiTypes . IShikiTheme ) => {
18- if ( typeof theme === 'string' ) {
19- return compatThemes [ theme ] || theme ;
20- } else if ( compatThemes [ theme . name ] ) {
21- return { ...theme , name : compatThemes [ theme . name ] } ;
22- } else {
23- return theme ;
24- }
25- } ;
26-
278const ASTRO_COLOR_REPLACEMENTS = {
289 '#000001' : 'var(--astro-code-color-text)' ,
2910 '#000002' : 'var(--astro-code-color-background)' ,
@@ -53,8 +34,6 @@ export default async function shiki({
5334 theme = 'github-dark' ,
5435 wrap = false ,
5536} : ShikiConfig = { } ) : Promise < AstroMarkdocConfig > {
56- theme = normalizeTheme ( theme ) ;
57-
5837 const cacheID : string = typeof theme === 'string' ? theme : theme . name ;
5938 if ( ! highlighterCache . has ( cacheID ) ) {
6039 highlighterCache . set (
0 commit comments