Skip to content

code highlight broken for Default Light/Dark+ theme  #53

@Krysl

Description

@Krysl

if (typeof theme === 'string') {
theme = await shiki.loadTheme(theme as any);
}

theme will not be load for Default Light+ or Default Dark+, because loadTheme need a path arg, not just a name.

 src/codeHighlighter.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/codeHighlighter.ts b/src/codeHighlighter.ts
index 002d214..d941241 100644
--- a/src/codeHighlighter.ts
+++ b/src/codeHighlighter.ts
@@ -107,7 +107,7 @@ export class CodeHighlighter {
 		}
 
 		if (typeof theme === 'string') {
-			theme = await shiki.loadTheme(theme as any);
+			theme = await shiki.loadTheme(`themes/${theme as any}.json`);
 		}
 
 		if (theme) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions