mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 17:55:52 +01:00
fix(client/ts): load only needed CodeMirror plugins
This commit is contained in:
@@ -32,7 +32,7 @@ const CODE_MIRROR: Library = {
|
||||
|
||||
const mimeTypes = mimeTypesService.getMimeTypes();
|
||||
for (const mimeType of mimeTypes) {
|
||||
if (mimeType.codeMirrorSource) {
|
||||
if (mimeType.enabled && mimeType.codeMirrorSource) {
|
||||
scriptsToLoad.push(mimeType.codeMirrorSource);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ import { MIME_TYPE_AUTO, MIME_TYPES_DICT, normalizeMimeTypeForCKEditor, type Mim
|
||||
import options from "./options.js";
|
||||
|
||||
interface MimeType extends MimeTypeDefinition {
|
||||
/**
|
||||
* True if this mime type was enabled by the user in the "Available MIME types in the dropdown" option in the Code Notes settings.
|
||||
*/
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user