fix(client/ts): load only needed CodeMirror plugins

This commit is contained in:
Elian Doran 2025-02-12 22:49:47 +02:00
parent 69a6739d1f
commit e7f5d1d280
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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;
}