mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): fix nytimes paragraph (#13146)
This commit is contained in:
@@ -81,10 +81,7 @@ module.exports = async (ctx) => {
|
||||
// Match 感谢|謝.*?cn.letters@nytimes.com。
|
||||
const ending = /感(谢|謝);.*?cn\.letters@nytimes\.com。/g;
|
||||
|
||||
const matching = '<div class="article-paragraph">';
|
||||
const formatted = '<br>' + matching;
|
||||
|
||||
single.description = result.description.replace(ending, '').split(matching).join(formatted);
|
||||
single.description = result.description?.replace(ending, '');
|
||||
|
||||
if (hasEnVersion) {
|
||||
single.title = result.title;
|
||||
|
||||
@@ -79,6 +79,11 @@ const ProcessFeed = (data, hasEnVersion = false) => {
|
||||
$(e).remove();
|
||||
});
|
||||
|
||||
// divide paragraphs with <p>
|
||||
content.find('div.article-paragraph').each((i, e) => {
|
||||
$(e).html(`<p>${$(e).html()}</p>`);
|
||||
});
|
||||
|
||||
if ($('figure.article-span-photo').length > 0) {
|
||||
// there is a cover photo
|
||||
const cover = $('figure.article-span-photo');
|
||||
|
||||
Reference in New Issue
Block a user