mirror of
https://github.com/zadam/trilium.git
synced 2026-01-02 04:34:25 +01:00
improve the protected note handling
This commit is contained in:
parent
03eaebc71c
commit
7e7f3ba78f
@ -149,11 +149,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