Skip to content

Commit

Permalink
Move away from deprecated shiki highlighting function (#6016)
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 4, 2024
1 parent 5e29c49 commit 1e31170
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';

/**
Expand All @@ -17,7 +17,7 @@ import dashLightTheme from '../syntax/dash-light.js';
* configure syntax highlighting for.
*/
export async function configureHighlighting(markdown) {
const highlighter = await getHighlighter({
const highlighter = await getSingletonHighlighter({
langs: [
'dart',
'yaml',
Expand All @@ -38,10 +38,9 @@ export async function configureHighlighting(markdown) {
'cmd',
'plaintext',
],
themes: [dashLightTheme],
});

await highlighter.loadTheme(dashLightTheme);

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

Expand Down

0 comments on commit 1e31170

Please sign in to comment.