From aaee0a788da35dddb5012d150c815e34210ba1ca Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 22 May 2025 22:57:04 +0900 Subject: enhance(frontend): シンタックスハイライトのエンジンをJavaScriptベースのものに変更 (#16084) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): シンタックスハイライトのエンジンをJavaScriptベースのものに変更 * Update Changelog --- packages/frontend/src/utility/code-highlighter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/frontend') diff --git a/packages/frontend/src/utility/code-highlighter.ts b/packages/frontend/src/utility/code-highlighter.ts index 4f2aff9d4c..7dca18d58f 100644 --- a/packages/frontend/src/utility/code-highlighter.ts +++ b/packages/frontend/src/utility/code-highlighter.ts @@ -4,7 +4,7 @@ */ import { createHighlighterCore } from 'shiki/core'; -import { createOnigurumaEngine } from 'shiki/engine/oniguruma'; +import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'; import darkPlus from 'shiki/themes/dark-plus.mjs'; import { bundledThemesInfo } from 'shiki/themes'; import { bundledLanguagesInfo } from 'shiki/langs'; @@ -71,7 +71,7 @@ async function initHighlighter() { const jsLangInfo = bundledLanguagesInfo.find(t => t.id === 'javascript'); const highlighter = await createHighlighterCore({ - engine: createOnigurumaEngine(() => import('shiki/onig.wasm?init')), + engine: createJavaScriptRegexEngine({ forgiving: true }), themes, langs: [ ...(jsLangInfo ? [async () => await jsLangInfo.import()] : []), -- cgit v1.2.3-freya