diff --git a/lib/routes/anthropic/news.ts b/lib/routes/anthropic/news.ts index c8e1539fa..9665209cf 100644 --- a/lib/routes/anthropic/news.ts +++ b/lib/routes/anthropic/news.ts @@ -15,7 +15,7 @@ export const route: Route = { }, ], name: 'News', - maintainers: ['etShaw-zh'], + maintainers: ['etShaw-zh', 'goestav'], handler, url: 'www.anthropic.com/news', }; @@ -49,9 +49,18 @@ async function handler(ctx) { const response = await ofetch(item.link!); const $ = load(response); - $('div[class^="PostDetail_b-social-share"]').remove(); + const content = $('#main-content'); + + // Remove meaningless information (heading, sidebar, quote carousel, footer and codeblock controls) + $(` + [class^="PostDetail_post-heading"], + [class^="ArticleDetail_sidebar-container"], + [class^="QuoteCarousel_carousel-controls"], + [class^="PostDetail_b-social-share"], + [class^="LandingPageSection_root"], + [class^="CodeBlock_controls"] + `).remove(); - const content = $('div[class*="PostDetail_post-detail__"]'); content.find('img').each((_, e) => { const $e = $(e); $e.removeAttr('style srcset');