diff --git a/package-lock.json b/package-lock.json index 86622ea..170e238 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "remark-parse": "^11.0.0", "semapro": "^1.1.0", "semver": "^7.3.7", - "shiki": "^0.14.1", + "shikiji": "^0.6.10", "unified": "^11.0.2", "vite": "^4.0.4", "vitest": "^0.34.1", @@ -2436,12 +2436,6 @@ "node": ">=8" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.0.tgz", - "integrity": "sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==", - "dev": true - }, "node_modules/ansi-styles": { "version": "4.3.0", "dev": true, @@ -11247,18 +11241,6 @@ "node": ">=8" } }, - "node_modules/shiki": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz", - "integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==", - "dev": true, - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/shikiji": { "version": "0.6.10", "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.10.tgz", @@ -13542,18 +13524,6 @@ } } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "dev": true, diff --git a/package.json b/package.json index eb8d80b..ed38a97 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "remark-parse": "^11.0.0", "semapro": "^1.1.0", "semver": "^7.3.7", - "shiki": "^0.14.1", + "shikiji": "^0.6.10", "unified": "^11.0.2", "vite": "^4.0.4", "vitest": "^0.34.1", diff --git a/site/src/util/highlight.js b/site/src/util/highlight.js index 44c8606..2b437fc 100644 --- a/site/src/util/highlight.js +++ b/site/src/util/highlight.js @@ -1,10 +1,14 @@ -import shiki from 'shiki'; +import {getHighlighter} from 'shikiji'; -const highlighterPromise = shiki.getHighlighter({ - theme: 'github-light', +const highlighterPromise = getHighlighter({ + themes: ['github-light'], + langs: ['javascript'], }); export async function highlight(code) { const highlighter = await highlighterPromise; - return highlighter.codeToHtml(code, {lang: 'js'}); + return highlighter.codeToHtml(code, { + lang: 'javascript', + theme: 'github-light', + }); }