fix(route/apnews): Tackle occasionally missing keywords in ld-json. (#16096)

This commit is contained in:
Andvari 2024-07-06 06:27:56 +08:00 committed by GitHub
parent 0126dbc153
commit b12f3fb21d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ export function fetchArticle(item) {
pubDate: parseDate(ldjson.datePublished),
updated: parseDate(ldjson.dateModified),
description: $('div.RichTextStoryBody').html(),
category: [`section:${$("meta[property='article:section']").attr('content')}`, ...ldjson.keywords],
category: [`section:${$("meta[property='article:section']").attr('content')}`, ...(ldjson.keywords ?? [])],
guid: $("meta[name='brightspot.contentId']").attr('content'),
author: ldjson.author,
...item,