mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-19 09:52:21 +08:00
fix(route): sehuatang append images in .pattl (#14055)
This commit is contained in:
+10
-12
@@ -88,20 +88,18 @@ module.exports = async (ctx) => {
|
||||
$(image).replaceWith($(`<img src="${file}">`));
|
||||
}
|
||||
}
|
||||
// if postMessage does not have any images, try to parse image url from `.pattl`
|
||||
if (images.length === 0) {
|
||||
const pattl = $('.pattl');
|
||||
const pattlImages = $(pattl).find('img');
|
||||
for (const pattlImage of pattlImages) {
|
||||
const file = $(pattlImage).attr('file');
|
||||
if (!file || file === 'undefined') {
|
||||
$(pattlImage).replaceWith('');
|
||||
} else {
|
||||
$(pattlImage).replaceWith($(`<img src="${file}" />`));
|
||||
}
|
||||
// also parse image url from `.pattl`
|
||||
const pattl = $('.pattl');
|
||||
const pattlImages = $(pattl).find('img');
|
||||
for (const pattlImage of pattlImages) {
|
||||
const file = $(pattlImage).attr('file');
|
||||
if (!file || file === 'undefined') {
|
||||
$(pattlImage).replaceWith('');
|
||||
} else {
|
||||
$(pattlImage).replaceWith($(`<img src="${file}" />`));
|
||||
}
|
||||
postMessage.append($(pattl));
|
||||
}
|
||||
postMessage.append($(pattl));
|
||||
$('em[onclick]').remove();
|
||||
|
||||
info.description = (postMessage.html() || '抓取原帖失败').replace(/ignore_js_op/g, 'div');
|
||||
|
||||
+11
-12
@@ -62,20 +62,19 @@ module.exports = async (ctx) => {
|
||||
$(image).replaceWith($(`<img src="${file}">`));
|
||||
}
|
||||
}
|
||||
// if postMessage does not have any images, try to parse image url from `.pattl`
|
||||
if (images.length === 0) {
|
||||
const pattl = $('.pattl');
|
||||
const pattlImages = $(pattl).find('img');
|
||||
for (const pattlImage of pattlImages) {
|
||||
const file = $(pattlImage).attr('file');
|
||||
if (!file || file === 'undefined') {
|
||||
$(pattlImage).replaceWith('');
|
||||
} else {
|
||||
$(pattlImage).replaceWith($(`<img src="${file}" />`));
|
||||
}
|
||||
// also parse image url from `.pattl`
|
||||
const pattl = $('.pattl');
|
||||
const pattlImages = $(pattl).find('img');
|
||||
for (const pattlImage of pattlImages) {
|
||||
const file = $(pattlImage).attr('file');
|
||||
if (!file || file === 'undefined') {
|
||||
$(pattlImage).replaceWith('');
|
||||
} else {
|
||||
$(pattlImage).replaceWith($(`<img src="${file}" />`));
|
||||
}
|
||||
postMessage.append($(pattl));
|
||||
}
|
||||
postMessage.append($(pattl));
|
||||
|
||||
$('em[onclick]').remove();
|
||||
|
||||
info.description = (postMessage.html() || '抓取原帖失败').replace(/ignore_js_op/g, 'div');
|
||||
|
||||
Reference in New Issue
Block a user