Update Shiki configuration to include JSON and HTML languages
📦 Build / 🛠️ Build app (push) Has been cancelled
🧑‍🚀 Check / ⚙️ Linting (push) Has been cancelled
🧑‍🚀 Check / 📦 SVGs Size (push) Has been cancelled

This commit is contained in:
pheralb
2025-09-05 11:27:00 +01:00
parent fff76243ec
commit ea4b598f2f
+4 -2
View File
@@ -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;