mirror of
https://github.com/zadam/trilium.git
synced 2026-07-07 19:43:59 +02:00
be loosy and honor startsWith application/javascript
This commit is contained in:
@@ -116,8 +116,7 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: Should we allow mime to also include backend, i.e loosely check that it starts with application/javascript and ignore the rest?
|
||||
if (type === "code" && mime === "application/javascript;env=frontend"){
|
||||
if (mime.startsWith("application/javascript")) {
|
||||
return "js";
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ interface RenderArgs {
|
||||
}
|
||||
|
||||
function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs) {
|
||||
if (renderArgs.isStatic && note.type == "code" && note.mime === "application/javascript;env=frontend") {
|
||||
if (renderArgs.isStatic && note.mime.startsWith("application/javascript")) {
|
||||
if (note.isProtected) {
|
||||
// TODO: how to handle this case here?
|
||||
throw new Error(`note ${note.noteId} is protected and cannot be exported`);
|
||||
|
||||
Reference in New Issue
Block a user