mirror of
https://github.com/zadam/trilium.git
synced 2025-12-31 19:54:25 +01:00
be loosy and honor startsWith application/javascript
This commit is contained in:
parent
afcd23cb99
commit
03eaebc71c
@ -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`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user