Remove \n, extra spaces from and trim author

This commit is contained in:
Hongbo Wu
2023-03-30 21:55:41 +08:00
parent deda0f8b7b
commit f77aae9810
2 changed files with 3 additions and 2 deletions

View File

@ -3022,7 +3022,8 @@ Readability.prototype = {
var textContent = articleContent.textContent;
return {
title: this._articleTitle,
byline: author,
// remove \n and extra spaces and trim the string
byline: author ? author.replace(/\n/g, ' ').replace(/\s+/g, ' ').trim() : null,
dir: this._articleDir,
content: this._serializer(articleContent),
textContent: textContent,

View File

@ -1,6 +1,6 @@
{
"title": "Novavax, eyeing the COVID 'vaccine hesitant' and kids, unveils new education campaigns as Nuvaxovid nears US finish line",
"byline": " 03:23pm",
"byline": "03:23pm",
"dir": null,
"excerpt": "Pfizer, Moderna and Johnson & Johnson were quickest off the mark in getting COVID vaccines into American arms, but Novavax is hoping to add another pandemic vaccine to the U.S. | Pfizer, Moderna and Johnson & Johnson were quickest off the mark in getting COVID vaccines into American arms, but Novavax is hoping to add another pandemic vaccine to the U.S. mix soon—and it's pushing new campaigns to get the word out.",
"siteName": "Fierce Pharma",