fix(route): parse error for nationalgeographic (#16362)

This commit is contained in:
Ethan
2024-08-06 08:33:32 +08:00
committed by GitHub
parent 1f235e79d5
commit c0f5d37aa8
2 changed files with 2 additions and 2 deletions
@@ -58,7 +58,7 @@ async function handler() {
cache.tryGet(item.link, async () => {
const response = await got(item.link);
const $ = load(response.data);
const mods = findNatgeo($).page.content.article.frms.find((f) => f.cmsType === 'ArticleBodyFrame').mods;
const mods = findNatgeo($).page.content.prismarticle.frms.find((f) => f.cmsType === 'ArticleBodyFrame').mods;
const bodyTile = mods.find((m) => m.edgs[0].cmsType === 'ArticleBodyTile').edgs[0];
item.author = bodyTile.cntrbGrp
@@ -13,7 +13,7 @@
{{ if b.type === 'p' }}
<p>{{@ b.cntnt.mrkup }}</p>
{{ else if b.type === 'inline' }}
{{ if b.cntnt.cmsType === 'image' }}
{{ if b.cntnt.cmsType === 'image' && b.cntnt.image?.src }}
<figure>
<img src="{{ b.cntnt.image.src }}" alt="{{ b.cntnt.image.altText }}">
<figcaption>{{@ b.cntnt.caption }}</figcaption>