1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 18:05:43 +02:00

enhance(frontend): シンタックスハイライトのエンジンをJavaScriptベースのものに変更 (#16084)

* refactor(frontend): シンタックスハイライトのエンジンをJavaScriptベースのものに変更

* Update Changelog
This commit is contained in:
かっこかり
2025-05-22 22:57:04 +09:00
committed by GitHub
parent e6e8bfa591
commit aaee0a788d
2 changed files with 5 additions and 2 deletions

View File

@@ -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()] : []),