pull/254/head
Zef Hemel 2022-12-29 12:59:45 +01:00
parent f78a0abbbe
commit 03c49dc937
1 changed files with 4 additions and 2 deletions

View File

@ -180,9 +180,11 @@ export function attachmentExtension(editor: Editor) {
return;
}
await editor.space.writeAttachment(finalFileName, "arraybuffer", data!);
let attachmentMarkdown = `[${finalFileName}](${finalFileName})`;
let attachmentMarkdown = `[${finalFileName}](${
encodeURIComponent(finalFileName)
})`;
if (mimeType.startsWith("image/")) {
attachmentMarkdown = `![](${finalFileName})`;
attachmentMarkdown = `![](${encodeURIComponent(finalFileName)})`;
}
editor.editorView!.dispatch({
changes: [