Fixes #243
parent
f78a0abbbe
commit
03c49dc937
|
@ -180,9 +180,11 @@ export function attachmentExtension(editor: Editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await editor.space.writeAttachment(finalFileName, "arraybuffer", data!);
|
await editor.space.writeAttachment(finalFileName, "arraybuffer", data!);
|
||||||
let attachmentMarkdown = `[${finalFileName}](${finalFileName})`;
|
let attachmentMarkdown = `[${finalFileName}](${
|
||||||
|
encodeURIComponent(finalFileName)
|
||||||
|
})`;
|
||||||
if (mimeType.startsWith("image/")) {
|
if (mimeType.startsWith("image/")) {
|
||||||
attachmentMarkdown = `![](${finalFileName})`;
|
attachmentMarkdown = `![](${encodeURIComponent(finalFileName)})`;
|
||||||
}
|
}
|
||||||
editor.editorView!.dispatch({
|
editor.editorView!.dispatch({
|
||||||
changes: [
|
changes: [
|
||||||
|
|
Loading…
Reference in New Issue