From 5dc2ad693a322dd8a41e5ec2867a1018bc465781 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Tue, 4 Feb 2020 20:48:35 +0800 Subject: [PATCH] fix: error in nowcoder/discuss (#3884) --- lib/routes/nowcoder/discuss.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/routes/nowcoder/discuss.js b/lib/routes/nowcoder/discuss.js index 7cfd7b1be..388ad7609 100644 --- a/lib/routes/nowcoder/discuss.js +++ b/lib/routes/nowcoder/discuss.js @@ -25,10 +25,8 @@ module.exports = async (ctx) => { .trim() .replace('\n', ' '), link: $(this) - .find('div.discuss-main.clearfix a') - .attr('href') - .match(/^\/discuss\/[0-9]*/gm) - .toString(), + .find('div.discuss-main.clearfix a[rel]') + .attr('href'), }; return info; }) @@ -51,9 +49,7 @@ module.exports = async (ctx) => { .text() .split(' ')[1]; - const description = $('.nc-post-content') - .html() - .trim(); + const description = $('.nc-post-content').html(); const single = { title: title,