Skip to content

Commit

Permalink
Move away from deprecated shiki highlighting function (#10988)
Browse files Browse the repository at this point in the history
shikijs/shiki#702 has more details about the
upstream deprecation and change.
  • Loading branch information
parlough authored Aug 2, 2024
1 parent 7df8cb9 commit 4986d24
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/_11ty/plugins/highlight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getHighlighter} from 'shiki';
import {getSingletonHighlighter} from 'shiki';
import dashLightTheme from '../syntax/dash-light.js';

import diff2html from "diff2html";
Expand All @@ -23,7 +23,7 @@ const _terminalLanguages = {
* configure syntax highlighting for.
*/
export async function configureHighlighting(markdown) {
const highlighter = await getHighlighter({
const highlighter = await getSingletonHighlighter({
langs: [
'dart',
'yaml',
Expand Down Expand Up @@ -51,10 +51,9 @@ export async function configureHighlighting(markdown) {
'csharp',
'cmake',
],
themes: [dashLightTheme],
});

await highlighter.loadTheme(dashLightTheme);

markdown.renderer.rules.fence = function (tokens, index) {
const token = tokens[index];

Expand Down

0 comments on commit 4986d24

Please sign in to comment.