Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit e7f5d1d

Browse files
committed
fix(client/ts): load only needed CodeMirror plugins
1 parent 69a6739 commit e7f5d1d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/public/app/services/library_loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const CODE_MIRROR: Library = {
3232

3333
const mimeTypes = mimeTypesService.getMimeTypes();
3434
for (const mimeType of mimeTypes) {
35-
if (mimeType.codeMirrorSource) {
35+
if (mimeType.enabled && mimeType.codeMirrorSource) {
3636
scriptsToLoad.push(mimeType.codeMirrorSource);
3737
}
3838
}

src/public/app/services/mime_types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { MIME_TYPE_AUTO, MIME_TYPES_DICT, normalizeMimeTypeForCKEditor, type Mim
22
import options from "./options.js";
33

44
interface MimeType extends MimeTypeDefinition {
5+
/**
6+
* True if this mime type was enabled by the user in the "Available MIME types in the dropdown" option in the Code Notes settings.
7+
*/
58
enabled: boolean;
69
}
710

0 commit comments

Comments
 (0)