From 56e3ccadf017b4642c4e81c44c222a37ede2e366 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 21 Sep 2022 12:16:13 +0800 Subject: [PATCH] Add test case for Axios AM newsletter --- packages/api/src/utils/parser.ts | 1 - .../axios-am/expected-metadata.json | 11 + .../newsletters/axios-am/expected.html | 227 +++++++++ .../newsletters/axios-am/source.html | 439 ++++++++++++++++++ .../test-pages/newsletters/axios-am/url.txt | 1 + 5 files changed, 678 insertions(+), 1 deletion(-) create mode 100644 packages/readabilityjs/test/test-pages/newsletters/axios-am/expected-metadata.json create mode 100644 packages/readabilityjs/test/test-pages/newsletters/axios-am/expected.html create mode 100644 packages/readabilityjs/test/test-pages/newsletters/axios-am/source.html create mode 100644 packages/readabilityjs/test/test-pages/newsletters/axios-am/url.txt diff --git a/packages/api/src/utils/parser.ts b/packages/api/src/utils/parser.ts index a1ec15678..01e97d0bd 100644 --- a/packages/api/src/utils/parser.ts +++ b/packages/api/src/utils/parser.ts @@ -262,7 +262,6 @@ export const parsePreparedContent = async ( const codeBlocks = article.dom.querySelectorAll('code') if (codeBlocks.length > 0) { codeBlocks.forEach((e) => { - console.log(e.textContent) if (e.textContent) { const att = hljs.highlightAuto(e.textContent) const code = dom.createElement('code') diff --git a/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected-metadata.json b/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected-metadata.json new file mode 100644 index 000000000..a78a10d05 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected-metadata.json @@ -0,0 +1,11 @@ +{ + "title": "Axios Finish Line", + "byline": null, + "dir": null, + "excerpt": "Start and end your work day with the stories that matter from Axios by Mike Allen, the world’s most-wired reporter. Then finish the night with what matters -- and lasts -- in life with insights from Mike, Jim VandeHei and Erica Pandey.", + "siteName": null, + "previewImage": "https://static.axios.com/img-email/socialcard_axiosam3.jpg", + "publishedDate": null, + "language": "English", + "readerable": true +} diff --git a/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected.html b/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected.html new file mode 100644 index 000000000..ee1a9c900 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/newsletters/axios-am/expected.html @@ -0,0 +1,227 @@ +
+
+ +
+ +   + + + + + + +   + + + + Presented By Pfizer + + + +   + + + + Axios AM Thought Bubble + + + + + By Mike Allen · Sep 20, 2022 + + + + +

Good morning. Here's Axios world reporter Dave Lawler with what you need to know about today's opening of the UN General Assembly gathering in New York.

+
    +
  • Smart Brevity™ count: 414 words ... a 2-minute read.
  • +
+ + + +   + + +   + + + + 1 big thing: Ukraine dominates UN General Assembly + + + + + Illustration of country name placards at the UN with microphones, with Ukraine's microphone bigger than all others. + + + + + + + + +

Illustration: Aïda Amer/Axios

+
+ + + +   + + + +

NEW YORK — The war in Ukraine is set to dominate this week's UN General Assembly meeting, overshadowing other global dilemmas like food security, climate change and other political and humanitarian crises around the world.

+

Why it matters: The Biden administration is intent on keeping up the pressure on Moscow, but some developing countries and aid groups have expressed concern that diplomatic skirmishes over the war will undermine a key opportunity to address other crises that deserve attention.

+

What they're saying: Stéphane Dujarric, spokesperson for Secretary-General António Guterres, said the war "does take up a lot of the space" and can make it harder to build momentum and consensus on other issues.

+
    +
  • Ecuadorian President Guillermo Lasso told Axios in an interview that the focus on Ukraine is understandable — as long as the big powers recognize that the knock-on effects of soaring food and fuel prices are hitting smaller, poorer countries hardest.
  • +
  • However, Linda Thomas-Greenfield, U.S. ambassador to the UN, argued ahead of the summit that those concerns were misplaced, as the war "will not be the only thing that we're dealing with." The U.S. and African and European Unions will co-host a summit on food security, for example.
  • +
+

Driving the news: Kicking off the six-day procession of speeches just now, Guterres called attention to the array of crises unfolding "far from the spotlight" — from Ethiopia, to Haiti, to Myanmar and beyond.

+
    +
  • He also acknowledged that rather than taking collective action, the international community — and the UN itself — had been "paralyzed" by "geopolitical divides."
  • +
  • That paralysis will be on display Thursday, when Secretary of State Tony Blinken, Russian Foreign Minister Sergey Lavrov and their counterparts are expected to discuss Ukraine at the UN Security Council. Russia is outnumbered on the council, but wields a veto.
  • +
+

The big picture: The UN General Assembly is back at full force for the first time in three years.

+
    +
  • The past two annual gatherings were derailed by COVID-19, but the pandemic has slipped down the agenda and most delegates are wandering UN HQ maskless.
  • +
+

What to watch: President Biden forfeited the prime U.S. speaking slot this morning (always second after Brazil) to travel back from Queen Elizabeth II's funeral, and will instead speak on Wednesday.

+
    +
  • China and Russia won't address the forum until Saturday, because both Xi Jinping and Vladimir Putin are staying home, and ministerial-level officials get the later speaking slots.
  • +
  • Ukrainian President Volodymyr Zelensky, however, is slated to address the forum remotely on Wednesday.
  • +
+ + + + + + + + + + + +   + + +   + + + +

A message from Pfizer

+ + + + + An Accord for a Healthier World + + + +   + + + + + + + +   + + + +

People living in lower income countries are disproportionately impacted by disease, causing lasting social and economic consequences.

+

Through an Accord for a Healthier World, we’re working to close the health equity gap.

+

We believe better health is possible for everyone, everywhere.

+ + + +   + + + +
+ + + HQ + + +
+ + +

Are you a fan of this email format?

+

It's called Smart Brevity®. Over 300 orgs use it — in a tool called Axios HQ — to drive productivity with clearer workplace communications.

+ + +
+ + +
+ + +
+ + +
+ +   + + + + +

Axios thanks our partners for supporting our newsletters. If you’re interested in advertising, learn more here.
Sponsorship has no influence on editorial content.

+
+ Axios, 3100 Clarendon B‌lvd, Arlington VA 22201 + + + +   + + + + You received this email because you signed up for newsletters from Axios.
+ Change your preferences or unsubscribe here. +
+ + + +   + + + + Was this email forwarded to you?
+ Sign up now to get Axios in your inbox.
+ + + +   + + + +

Follow Axios on social media:

+ Axios on Facebook + Axios on Twitter + Axios on Instagram + + + +   + + + +   + +
+ + +
+
\ No newline at end of file diff --git a/packages/readabilityjs/test/test-pages/newsletters/axios-am/source.html b/packages/readabilityjs/test/test-pages/newsletters/axios-am/source.html new file mode 100644 index 000000000..4e4149f13 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/newsletters/axios-am/source.html @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ Crowding out other crises | Tuesday, September 20, 2022 +
+ + + + +
+ + + + + + + + +
 
Axios Logo  Alerts
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + +
+ View in browser +
+
 
+ Presented By Pfizer +
 
+ Axios AM Thought Bubble +
+ By + Mike Allen + · + Sep 20, 2022 + +
+

Good morning. Here's Axios world reporter Dave Lawler with what you need to know about today's opening of the UN General Assembly gathering in New York.

  • Smart Brevity™ count: 414 words ... a 2-minute read.
+
 
 
+ + 1 big thing: Ukraine dominates UN General Assembly + +
+ Illustration of country name placards at the UN with microphones, with Ukraine's microphone bigger than all others. +
+ +

Illustration: Aïda Amer/Axios

+
+
 
+

NEW YORK — The war in Ukraine is set to dominate this week's UN General Assembly meeting, overshadowing other global dilemmas like food security, climate change and other political and humanitarian crises around the world.

Why it matters: The Biden administration is intent on keeping up the pressure on Moscow, but some developing countries and aid groups have expressed concern that diplomatic skirmishes over the war will undermine a key opportunity to address other crises that deserve attention.

What they're saying: Stéphane Dujarric, spokesperson for Secretary-General António Guterres, said the war "does take up a lot of the space" and can make it harder to build momentum and consensus on other issues.

  • Ecuadorian President Guillermo Lasso told Axios in an interview that the focus on Ukraine is understandable — as long as the big powers recognize that the knock-on effects of soaring food and fuel prices are hitting smaller, poorer countries hardest.
  • However, Linda Thomas-Greenfield, U.S. ambassador to the UN, argued ahead of the summit that those concerns were misplaced, as the war "will not be the only thing that we're dealing with." The U.S. and African and European Unions will co-host a summit on food security, for example.

Driving the news: Kicking off the six-day procession of speeches just now, Guterres called attention to the array of crises unfolding "far from the spotlight" — from Ethiopia, to Haiti, to Myanmar and beyond.

  • He also acknowledged that rather than taking collective action, the international community — and the UN itself — had been "paralyzed" by "geopolitical divides."
  • That paralysis will be on display Thursday, when Secretary of State Tony Blinken, Russian Foreign Minister Sergey Lavrov and their counterparts are expected to discuss Ukraine at the UN Security Council. Russia is outnumbered on the council, but wields a veto.

The big picture: The UN General Assembly is back at full force for the first time in three years.

  • The past two annual gatherings were derailed by COVID-19, but the pandemic has slipped down the agenda and most delegates are wandering UN HQ maskless.

What to watch: President Biden forfeited the prime U.S. speaking slot this morning (always second after Brazil) to travel back from Queen Elizabeth II's funeral, and will instead speak on Wednesday.

  • China and Russia won't address the forum until Saturday, because both Xi Jinping and Vladimir Putin are staying home, and ministerial-level officials get the later speaking slots.
  • Ukrainian President Volodymyr Zelensky, however, is slated to address the forum remotely on Wednesday.
+
+ Share on Facebook + Tweet this Story + Post to LinkedIn + Email this Story +
 
 
+

+ A message from Pfizer +

+
+ An Accord for a Healthier World +
 
+ +
 
+

People living in lower income countries are disproportionately impacted by disease, causing lasting social and economic consequences.

+

Through an Accord for a Healthier World, we’re working to close the health equity gap.

+

We believe better health is possible for everyone, everywhere.

+
 
+ + + + + +
+ HQ + + + + + +
+
Are you a fan of this email format?
+ It's called Smart Brevity®. Over 300 orgs use it — in a tool called Axios HQ — to drive productivity with clearer workplace communications.
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ +

Axios thanks our partners for supporting our newsletters. If you’re interested in advertising, learn more here. +
Sponsorship has no influence on editorial content.

+
+ + Axios, 3100 Clarendon B‌lvd, Arlington VA 22201 + +
 
+ + You received this email because you signed up for newsletters from Axios.
+ Change your preferences or unsubscribe here. +
+
 
+ + Was this email forwarded to you?
+ Sign up now to get Axios in your inbox. +
+
 
+

Follow Axios on social media:

+ Axios on Facebook + Axios on Twitter + Axios on Instagram +
 
 
+ + +
+
+                                               +
+ + diff --git a/packages/readabilityjs/test/test-pages/newsletters/axios-am/url.txt b/packages/readabilityjs/test/test-pages/newsletters/axios-am/url.txt new file mode 100644 index 000000000..765ea46a6 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/newsletters/axios-am/url.txt @@ -0,0 +1 @@ +https://link.axios.com/view/624d3447776363102d0b2208hbv6u.bdsb/95d21d5c \ No newline at end of file