@@ -6,24 +6,6 @@ export type CodeExtensionOptions = Omit<RehypeShikiOptions, 'theme' | 'themes'>
66 theme ?: Theme | DualTheme ;
77} ;
88
9- // FIXME: find a better solution then copy-pasting these functions in next version.
10- // However, when importing from carta-md, this causes a MODULE_NOT_FOUND error
11- // for some reason.
12- /**
13- * Checks if a theme is a dual theme.
14- * @param theme The theme to check.
15- * @returns Whether the theme is a dual theme.
16- */
17- export const isDualTheme = ( theme : Theme | DualTheme ) : theme is DualTheme =>
18- typeof theme == 'object' && 'light' in theme && 'dark' in theme ;
19-
20- /**
21- * Checks if a theme is a single theme.
22- * @param theme The theme to check.
23- * @returns Whether the theme is a single theme.
24- */
25- export const isSingleTheme = ( theme : Theme | DualTheme ) : theme is Theme => ! isDualTheme ( theme ) ;
26-
279/**
2810 * Carta code highlighting plugin. Themes available on [GitHub](https://github.com/speed-highlight/core/tree/main/dist/themes).
2911 */
@@ -44,7 +26,7 @@ export const code = (options?: CodeExtensionOptions): Plugin => {
4426 theme = highlighter . settings . themeHash ; // Use the theme specified in the highlighter
4527 }
4628
47- if ( isSingleTheme ( theme ) ) {
29+ if ( highlighter . utils . isSingleTheme ( theme ) ) {
4830 processor . use ( rehypeShikiFromHighlighter , shikiHighlighter , { ...options , theme } ) ;
4931 } else {
5032 processor . use ( rehypeShikiFromHighlighter , shikiHighlighter , {
0 commit comments