diff --git a/lib/v2/sehuatang/index.js b/lib/v2/sehuatang/index.js index 8d9e9a90c..b4b8db908 100644 --- a/lib/v2/sehuatang/index.js +++ b/lib/v2/sehuatang/index.js @@ -88,20 +88,18 @@ module.exports = async (ctx) => { $(image).replaceWith($(``)); } } - // 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($(``)); - } + // 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($(``)); } - postMessage.append($(pattl)); } + postMessage.append($(pattl)); $('em[onclick]').remove(); info.description = (postMessage.html() || '抓取原帖失败').replace(/ignore_js_op/g, 'div'); diff --git a/lib/v2/sehuatang/user.js b/lib/v2/sehuatang/user.js index 889ebcf17..cf0fb40bc 100644 --- a/lib/v2/sehuatang/user.js +++ b/lib/v2/sehuatang/user.js @@ -62,20 +62,19 @@ module.exports = async (ctx) => { $(image).replaceWith($(``)); } } - // 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($(``)); - } + // 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($(``)); } - postMessage.append($(pattl)); } + postMessage.append($(pattl)); + $('em[onclick]').remove(); info.description = (postMessage.html() || '抓取原帖失败').replace(/ignore_js_op/g, 'div');