Skip to content

Commit 7c41f06

Browse files
enhance: use js engine
1 parent a83c331 commit 7c41f06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.vitepress/pages/Playground.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ import { inBrowser } from 'vitepress';
9393
import { ref, computed, useTemplateRef, nextTick, onMounted, watch, onUnmounted } from 'vue';
9494
import { createHighlighterCore } from 'shiki/core';
9595
import type { HighlighterCore, LanguageRegistration } from 'shiki/core';
96-
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
96+
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
9797
import lzString from 'lz-string';
9898
import { useThrottle } from '../scripts/throttle';
9999
import type { Runner } from '../scripts/runner';
@@ -129,7 +129,9 @@ async function init() {
129129
import('shiki/themes/github-light.mjs'),
130130
import('shiki/themes/github-dark.mjs'),
131131
],
132-
engine: createOnigurumaEngine(import('shiki/onig.wasm?init')),
132+
engine: createJavaScriptRegexEngine({
133+
forgiving: true,
134+
}),
133135
});
134136
}
135137

0 commit comments

Comments
 (0)