diff --git a/src/public/app/services/note_content_renderer.js b/src/public/app/services/note_content_renderer.js index f7c970f1b..93bd0d267 100644 --- a/src/public/app/services/note_content_renderer.js +++ b/src/public/app/services/note_content_renderer.js @@ -141,6 +141,33 @@ async function getRenderedContent(note, options = {}) { $renderedContent.append($content); } + else if (type === 'canvas-note') { + await libraryLoader.requireLibrary(libraryLoader.EXCALIDRAW_UTILS); + const {exportToSvg} = window.ExcalidrawUtils + + const noteComplement = await froca.getNoteComplement(note.noteId); + const content = noteComplement.content || ""; + + console.log("canvas-note book", note, noteComplement, content); + + try { + const data = JSON.parse(content) + const excData = { + type: "excalidraw", + version: 2, + source: "trilium", + elements: data.elements, + appState: data.appState, + files: data.files, + } + const svg = await exportToSvg(excData); + console.log("canvas-note content book", data, svg); + $renderedContent.append($('