diff --git a/src/renderer/plugins/markdown-link.ts b/src/renderer/plugins/markdown-link.ts index 5adb15c6..9f962004 100644 --- a/src/renderer/plugins/markdown-link.ts +++ b/src/renderer/plugins/markdown-link.ts @@ -183,7 +183,12 @@ export default { try { const originSrc = node.getAttribute(DOM_ATTR_NAME.ORIGIN_SRC) const res: Response = await ctx.api.fetchHttp(srcAttr) - const file = new File([await res.blob()], originSrc ? ctx.utils.path.basename(originSrc) : 'img') + const fileName = originSrc ? ctx.utils.path.basename(originSrc) : 'img' + const file = new File( + [await res.blob()], + fileName, + { type: ctx.lib.mime.getType(fileName) || undefined } + ) let url: string | undefined if (options.inlineLocalImage) {