File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { DualTheme , Theme , isSingleTheme , type Plugin } from 'carta-md' ;
2- import { type RehypeShikiOptions } from '@shikijs/rehype' ;
1+ import type { DualTheme , Theme , Plugin } from 'carta-md' ;
2+ import type { RehypeShikiOptions } from '@shikijs/rehype' ;
33import rehypeShikiFromHighlighter from '@shikijs/rehype/core' ;
44
55export type CodeExtensionOptions = Omit < RehypeShikiOptions , 'theme' | 'themes' > & {
@@ -17,6 +17,7 @@ export const code = (options?: CodeExtensionOptions): Plugin => {
1717 type : 'rehype' ,
1818 async transform ( { processor, carta } ) {
1919 let theme = options ?. theme ;
20+ const { isSingleTheme } = await import ( 'carta-md' ) ;
2021 const highlighter = await carta . highlighter ( ) ;
2122 if ( ! theme ) {
2223 theme = highlighter . theme ; // Use the theme specified in the highlighter
You can’t perform that action at this time.
0 commit comments