fix(highlightjs): syntax highlight not working in settings

This commit is contained in:
Elian Doran 2025-05-18 18:34:12 +03:00
parent f6728ca931
commit 5a186e6853
No known key found for this signature in database

View File

@ -1,11 +1,11 @@
import type { OptionMap } from "@triliumnext/commons"; import { normalizeMimeTypeForCKEditor, type OptionMap } from "@triliumnext/commons";
import { t } from "../../../../services/i18n.js"; import { t } from "../../../../services/i18n.js";
import server from "../../../../services/server.js"; import server from "../../../../services/server.js";
import OptionsWidget from "../options_widget.js"; import OptionsWidget from "../options_widget.js";
import { ensureMimeTypesForHighlighting, loadHighlightingTheme } from "../../../../services/syntax_highlight.js"; import { ensureMimeTypesForHighlighting, loadHighlightingTheme } from "../../../../services/syntax_highlight.js";
import { Themes } from "@triliumnext/highlightjs"; import { Themes } from "@triliumnext/highlightjs";
const SAMPLE_LANGUAGE = "javascript"; const SAMPLE_LANGUAGE = normalizeMimeTypeForCKEditor("application/javascript;env=frontend");
const SAMPLE_CODE = `\ const SAMPLE_CODE = `\
const n = 10; const n = 10;
greet(n); // Print "Hello World" for n times greet(n); // Print "Hello World" for n times