fix(route/keylol): handle lazy load image (#16346)
This commit is contained in:
parent
45818f4e7b
commit
e2f6c70290
|
|
@ -186,6 +186,17 @@ async function handler(ctx) {
|
|||
function getDescription($) {
|
||||
const descriptionEl = $('td.t_f');
|
||||
descriptionEl.find('div.rnd_ai_pr').remove(); // remove ad image
|
||||
|
||||
// handle lazyload image
|
||||
descriptionEl.find('img').each((_, img) => {
|
||||
img = $(img);
|
||||
if (img.attr('src')?.endsWith('none.gif') && img.attr('file')) {
|
||||
img.attr('src', img.attr('file'));
|
||||
img.removeAttr('file');
|
||||
img.removeAttr('zoomfile');
|
||||
}
|
||||
});
|
||||
|
||||
return descriptionEl.length > 0 ? descriptionEl.html() : $('div.alert_info').html();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue