mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-03 10:38:03 +08:00
feat(route): add slowmist news (#10044)
* feat(route): add slowmist news * feat(utils): remove useless ul for code section * docs: add slowmist news route docs * docs(quick-start): new router under /lib/v2 * test(utils): add test fixArticleContent for new wechat-mp code * feat(router): update radar source of slowmist
This commit is contained in:
@@ -104,6 +104,14 @@ const fixArticleContent = (html, skipImg = false) => {
|
||||
}
|
||||
});
|
||||
|
||||
// add breaks in code section
|
||||
$('code').each((_, code) => {
|
||||
$('<br>').insertAfter(code);
|
||||
});
|
||||
|
||||
// clear line index tags in code section
|
||||
$('.code-snippet__line-index').remove();
|
||||
|
||||
// fix single picture article
|
||||
// example: https://mp.weixin.qq.com/s/4p5YmYuASiQSYFiy7KqydQ
|
||||
$('script').each((_, script) => {
|
||||
@@ -186,7 +194,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
||||
let summary = $('meta[name=description]').attr('content');
|
||||
summary = summary !== title ? summary : '';
|
||||
let description = fixArticleContent($('#js_content'));
|
||||
|
||||
// No article get or article is too short, try the original url
|
||||
const originalUrl = detectOriginalArticleUrl($);
|
||||
if (originalUrl) {
|
||||
@@ -211,7 +218,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
||||
|
||||
let mpName = $('.profile_nickname').first().text();
|
||||
mpName = mpName && mpName.trim();
|
||||
|
||||
return { title, author, description, summary, pubDate, mpName, link: url };
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user