mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
fix(client/ts): load only needed CodeMirror plugins
This commit is contained in:
parent
69a6739d1f
commit
e7f5d1d280
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user