From 19971bc6385b1dffb65467ea774197fd247051c8 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 14 Dec 2023 23:22:43 +0800 Subject: [PATCH] [feat] memos img.externalLink --- source/js/plugins/memos.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/js/plugins/memos.js b/source/js/plugins/memos.js index 07af2bf..e2862f3 100644 --- a/source/js/plugins/memos.js +++ b/source/js/plugins/memos.js @@ -84,14 +84,18 @@ const MemosJS = { var imgs = []; for (let res of item.resourceList) { if (res.type?.includes('image/')) { - imgs.push(res.id); - console.log('type', res.type); + imgs.push(res); } } if (imgs.length > 0) { cell += '
'; - for (let id of imgs) { - cell += `
`; + for (let img of imgs) { + if (img.externalLink?.length > 0) { + cell += `
`; + } else { + cell += `
`; + } + } cell += '
'; }