mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
✨ Update Shiki configuration to include JSON and HTML languages
This commit is contained in:
+4
-2
@@ -11,8 +11,10 @@ import githubLight from "@shikijs/themes/github-light";
|
||||
import githubDark from "@shikijs/themes/github-dark";
|
||||
|
||||
// Languages:
|
||||
import html from "@shikijs/langs/html";
|
||||
import ts from "@shikijs/langs/ts";
|
||||
import bash from "@shikijs/langs/bash";
|
||||
import json from "@shikijs/langs/json";
|
||||
|
||||
let jsEngine: RegexEngine | null = null;
|
||||
let highlighter: Promise<HighlighterCore> | null = null;
|
||||
@@ -29,13 +31,13 @@ const rehypeShikiOptions: RehypeShikiOptions = {
|
||||
light: "github-light",
|
||||
dark: "github-dark",
|
||||
},
|
||||
langs: [bash, ts],
|
||||
langs: [bash, ts, json, html],
|
||||
};
|
||||
|
||||
const shikiHighlighter = async (): Promise<HighlighterCore> => {
|
||||
highlighter ??= createHighlighterCore({
|
||||
themes: [githubLight, githubDark],
|
||||
langs: [bash, ts],
|
||||
langs: [bash, ts, json, html],
|
||||
engine: getShikiEngine(),
|
||||
});
|
||||
return highlighter;
|
||||
|
||||
Reference in New Issue
Block a user