fix(route): sehuatang append images in `.pattl` (#14055)
This commit is contained in:
parent
027c16804f
commit
bab09f9c4e
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue