diff --git a/src/renderer/plugins/editor-attachment.ts b/src/renderer/plugins/editor-attachment.ts index b0fcd967..8ea38576 100644 --- a/src/renderer/plugins/editor-attachment.ts +++ b/src/renderer/plugins/editor-attachment.ts @@ -45,7 +45,8 @@ function addAttachment (asImage = false) { async function linkFile () { const { filePaths } = await api.choosePath({ properties: ['openFile', 'multiSelections'] }) const useList = filePaths.length > 1 - for (const path of filePaths) { + for (let path of filePaths) { + path = path.replaceAll('\\', '/') const filename = basename(path).replace(/[[\]]/g, '') insert(`${useList ? '- ' : ''}[${filename}](file://${encodeMarkdownLink(path)})\n`) }