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
+1 -1
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,