Skip to content

Commit 2faca0b

Browse files
authored
feat(shiki): use wasm engine (#320)
1 parent e44f080 commit 2faca0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/highlighter.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
import { createHighlighterCoreSync } from '@shikijs/core';
4-
import { createJavaScriptRegexEngine } from '@shikijs/engine-javascript';
4+
import { createOnigurumaEngine } from '@shikijs/engine-oniguruma';
55
import { toString } from 'hast-util-to-string';
66
import { h as createElement } from 'hastscript';
77
import { SKIP, visit } from 'unist-util-visit';
@@ -15,7 +15,7 @@ const languagePrefix = 'language-';
1515
// Creates a Singleton instance for Shiki's syntax highlighter using WASM
1616
const shikiHighlighter = createHighlighterCoreSync({
1717
...shikiConfig,
18-
engine: createJavaScriptRegexEngine(),
18+
engine: await createOnigurumaEngine(import('shiki/wasm')),
1919
});
2020

2121
// Creates a static button element which is used for the "copy" button

0 commit comments

Comments
 (0)