fix(route/sciencedirect): fix that abstract will not show when highlights appear (#20333)
* fix(route/sciencedirect): fix abstract will not show when highlights appear now both abstract and highlights will show. only abstract will be shown when there is no highlights for the paper * Update current-issue.ts * fix(route/sciencedirect): fix vary length of abstract array
This commit is contained in:
@@ -76,8 +76,14 @@ async function handler(ctx) {
|
||||
},
|
||||
});
|
||||
|
||||
item.description = response.data[0].abstracts[0].html ?? '';
|
||||
|
||||
const abstracts = response.data?.[0]?.abstracts ?? [];
|
||||
item.description =
|
||||
abstracts.length === 0
|
||||
? ''
|
||||
: abstracts
|
||||
.map((abs) => abs?.html ?? '')
|
||||
.filter(Boolean)
|
||||
.join('<br/><br/>');
|
||||
return item;
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user