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:
@@ -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()] : []),
|
||||
|
||||
Reference in New Issue
Block a user