mirror of
https://github.com/zadam/trilium.git
synced 2026-01-07 07:04:25 +01:00
Merge branch 'static-correct-type' into static-implement-sharejs
* static-correct-type: improve the protected note handling be loosy and honor startsWith application/javascript
This commit is contained in:
commit
1d3e971ed7
@ -155,11 +155,11 @@ interface RenderArgs {
|
||||
}
|
||||
|
||||
function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs) {
|
||||
// When rendering static share, non-protected JavaScript notes should be rendered as-is.
|
||||
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`);
|
||||
}
|
||||
return `console.log("Protected note cannot be exported.");`
|
||||
};
|
||||
|
||||
return note.getContent();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user