🐛 Fix: fix copy link bug

This commit is contained in:
萌萌哒赫萝
2023-04-17 19:39:51 +08:00
parent d55458197a
commit 72c9374a26
3 changed files with 17 additions and 6 deletions

View File

@@ -30,13 +30,15 @@ export default async (style: IPasteStyle, item: ImgInfo, customLink: string | un
if (useShortUrl) {
url = await generateShortUrl(url)
}
const copyedItem = JSON.parse(JSON.stringify(item))
copyedItem.url = url
const _customLink = customLink || '![$fileName]($url)'
const tpl = {
markdown: `![](${url})`,
HTML: `<img src="${url}"/>`,
URL: url,
UBB: `[IMG]${url}[/IMG]`,
Custom: formatCustomLink(_customLink, item)
Custom: formatCustomLink(_customLink, copyedItem)
}
return tpl[style]
}