mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 13:56:11 +01:00
refactor(export/zip): separate building provider into own method
This commit is contained in:
@@ -35,13 +35,15 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
|
||||
}
|
||||
}
|
||||
|
||||
prepareContent(title: string, content: string | Buffer, noteMeta: NoteMeta, note: BNote, branch: BBranch): string | Buffer {
|
||||
prepareContent(title: string, content: string | Buffer, noteMeta: NoteMeta, note: BNote | undefined, branch: BBranch): string | Buffer {
|
||||
if (!noteMeta?.notePath?.length) {
|
||||
throw new Error("Missing note path.");
|
||||
}
|
||||
const basePath = "../".repeat(noteMeta.notePath.length - 1);
|
||||
|
||||
content = renderNoteForExport(note, branch, basePath);
|
||||
if (note) {
|
||||
content = renderNoteForExport(note, branch, basePath);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user