mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
chore: 部分代码优化 (#1674)
This commit is contained in:
@@ -94,7 +94,7 @@ module.exports = {
|
||||
if (item.pictures) {
|
||||
item.pictures.forEach((pic) => {
|
||||
if (pic.format === 'gif') {
|
||||
description += `<img src="${pic.picUrl.split('?imageMogr2/')[0]}"></picture>`;
|
||||
description += `<img referrerpolicy="no-referrer" src="${pic.picUrl.split('?imageMogr2/')[0]}"></picture>`;
|
||||
} else {
|
||||
// jpeg, bmp, png, gif, webp
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
|
||||
@@ -110,7 +110,9 @@ module.exports = {
|
||||
break;
|
||||
}
|
||||
const imgUrl = pic.picUrl.match(/\.[a-z0-9]+?\?imageMogr2/) ? pic.picUrl.split('?imageMogr2/')[0] : pic.picUrl.replace(/thumbnail\/.+/, '');
|
||||
description += `<br/><picture><source srcset="${pic.picUrl.split('/thumbnail/')[0]}/strip/format/webp" type="image/webp"><source srcset="${imgUrl}" type="image/${type}"><img src="${imgUrl}"></picture>`;
|
||||
description += `<br/><picture><source srcset="${
|
||||
pic.picUrl.split('/thumbnail/')[0]
|
||||
}/strip/format/webp" type="image/webp"><source srcset="${imgUrl}" type="image/${type}"><img referrerpolicy="no-referrer" src="${imgUrl}"></picture>`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user