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";
|
import githubDark from "@shikijs/themes/github-dark";
|
||||||
|
|
||||||
// Languages:
|
// Languages:
|
||||||
|
import html from "@shikijs/langs/html";
|
||||||
import ts from "@shikijs/langs/ts";
|
import ts from "@shikijs/langs/ts";
|
||||||
import bash from "@shikijs/langs/bash";
|
import bash from "@shikijs/langs/bash";
|
||||||
|
import json from "@shikijs/langs/json";
|
||||||
|
|
||||||
let jsEngine: RegexEngine | null = null;
|
let jsEngine: RegexEngine | null = null;
|
||||||
let highlighter: Promise<HighlighterCore> | null = null;
|
let highlighter: Promise<HighlighterCore> | null = null;
|
||||||
@@ -29,13 +31,13 @@ const rehypeShikiOptions: RehypeShikiOptions = {
|
|||||||
light: "github-light",
|
light: "github-light",
|
||||||
dark: "github-dark",
|
dark: "github-dark",
|
||||||
},
|
},
|
||||||
langs: [bash, ts],
|
langs: [bash, ts, json, html],
|
||||||
};
|
};
|
||||||
|
|
||||||
const shikiHighlighter = async (): Promise<HighlighterCore> => {
|
const shikiHighlighter = async (): Promise<HighlighterCore> => {
|
||||||
highlighter ??= createHighlighterCore({
|
highlighter ??= createHighlighterCore({
|
||||||
themes: [githubLight, githubDark],
|
themes: [githubLight, githubDark],
|
||||||
langs: [bash, ts],
|
langs: [bash, ts, json, html],
|
||||||
engine: getShikiEngine(),
|
engine: getShikiEngine(),
|
||||||
});
|
});
|
||||||
return highlighter;
|
return highlighter;
|
||||||
|
|||||||
Reference in New Issue
Block a user