diff --git a/packages/content-handler/src/websites/youtube-handler.ts b/packages/content-handler/src/websites/youtube-handler.ts index cd7f87c95..3779241dd 100644 --- a/packages/content-handler/src/websites/youtube-handler.ts +++ b/packages/content-handler/src/websites/youtube-handler.ts @@ -80,7 +80,7 @@ export class YoutubeHandler extends ContentHandler { - + diff --git a/packages/readabilityjs/Readability.js b/packages/readabilityjs/Readability.js index f8db3d884..2d57ba5ce 100644 --- a/packages/readabilityjs/Readability.js +++ b/packages/readabilityjs/Readability.js @@ -3101,13 +3101,18 @@ Readability.prototype = { this._postProcessContent(articleContent); // If we haven't found an excerpt in the article's metadata, use the article's - // first paragraph as the excerpt. This is used for displaying a preview of + // first meaningful paragraph (more than 50 characters) as the excerpt. This is used for displaying a preview of // the article's content. if (!metadata.excerpt) { var paragraphs = articleContent.getElementsByTagName("p"); - if (paragraphs.length > 0) { - metadata.excerpt = paragraphs[0].textContent.trim(); - } + for (const p of paragraphs) { + const text = p.textContent.trim(); + + if (text.length > 50) { + metadata.excerpt = text; + break; + } + }; } if (!metadata.siteName) { // Fallback to hostname diff --git a/packages/readabilityjs/test/test-pages/substack-email/expected-metadata.json b/packages/readabilityjs/test/test-pages/substack-email/expected-metadata.json index 6b0bf82df..7522cf31a 100644 --- a/packages/readabilityjs/test/test-pages/substack-email/expected-metadata.json +++ b/packages/readabilityjs/test/test-pages/substack-email/expected-metadata.json @@ -2,8 +2,9 @@ "title": "New corona regs, Kotti cops, electric cars", "byline": "Andrew Bulkeley", "dir": null, - "excerpt": "Hello 20\n Percent,", + "excerpt": "We\n agreed to confine my wife to my son’s room. She was included in the\n democratic process because she’s the one with corona. And now every time she heads out\n for food, to use the restroom or to just change clothes, we go through a complex tetris of\n opening windows, dawning masks and maintaining social distancing. A weird thing in your own\n house. But we’ve survived lice, moths in the larder and even black mold - Berlin\n things. So we’ll get through this too - so far it’s been little more\n than a serious cold for her (YMMV). Since we’re all\n boostered, it will be interesting to see who is also felled by the virus. I’m fine for\n now (knocks on wooden floor).", "siteName": "fakehost", "publishedDate": "2001-01-13T16:00:00.000Z", + "language": "English", "readerable": true } diff --git a/packages/readabilityjs/test/test-pages/substack-email/expected.html b/packages/readabilityjs/test/test-pages/substack-email/expected.html index 17d963cd9..9ba5b948d 100644 --- a/packages/readabilityjs/test/test-pages/substack-email/expected.html +++ b/packages/readabilityjs/test/test-pages/substack-email/expected.html @@ -1,4 +1,4 @@ -
Why make it easy when you can make it more complex? Corona regulations are generally passed by the federal government and then have to be passed again at the state level, often with inexplicable local flourishes, before becoming law. This creates a Germany-wide quilt of differing regulations that few understand. This week is no different though Berlin has decided to stretch the introduction over two days. Starting today in Berlin, people in contact with an infected person no longer have to go into quarantine if they’ve received a booster vaccination or belong to the new “fresh” category - “freshly” vaccinated or recovered. “Fresh” means within the past three months. Quarantine for other contact persons now ends after 10 days, rather than 14, and people can test out (rapid antibody or PCR) after 7 days. Is anyone enforcing this?
FFP2 masks are now mandatory on public transport, so keep the surgical masks until the next time politicians change their minds (the only constant in this pandemic). Bars and restaurants are also 2G plus, which means recently recovered or vaccinated PLUS a same-day negative test result or proof of a booster vaccination. This applies to any other indoor events with more than 10 people as well.
-+