Handle inline images and attachments via data urls

This commit is contained in:
Zef Hemel
2023-01-08 15:29:34 +01:00
parent 0365673c41
commit 8dac58f38a
7 changed files with 53 additions and 16 deletions
+6
View File
@@ -38,6 +38,12 @@ export function editorSyscalls(editor: Editor): SysCallMapping {
win.focus();
}
},
"editor.downloadFile": (_ctx, filename: string, dataUrl: string) => {
const link = document.createElement("a");
link.href = dataUrl;
link.download = filename;
link.click();
},
"editor.flashNotification": (
_ctx,
message: string,