mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix: fix embed image mime type
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user