Fixes #243
parent
f78a0abbbe
commit
03c49dc937
|
@ -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: [
|
||||
|
|
Loading…
Reference in New Issue