fix(routes/udn/global): Correctly serialize multi-element article content (#20194)
This commit is contained in:
parent
016ea35ac1
commit
fe416a017a
|
|
@ -81,7 +81,11 @@ async function handler(ctx) {
|
|||
item.pubDate = timezone(parseDate(content('meta[property="article:published_time"]').attr('content')), +8);
|
||||
|
||||
const mainImage = content('.article-content__focus').html();
|
||||
const articleBodyHtml = content('.article-content__editor').find('p, figure, h2, .video-container').html();
|
||||
const articleBodyHtml = content('.article-content__editor')
|
||||
.find('p, figure, h2, .video-container')
|
||||
.toArray()
|
||||
.map((e) => content.html(e))
|
||||
.join('');
|
||||
|
||||
item.description = mainImage + articleBodyHtml;
|
||||
item.category = content('meta[name="news_keywords"]').attr('content').split(',');
|
||||
|
|
|
|||
|
|
@ -63,7 +63,11 @@ async function handler(ctx) {
|
|||
item.pubDate = timezone(parseDate(content('meta[property="article:published_time"]').attr('content')), +8);
|
||||
|
||||
const mainImage = content('.article-content__focus').html();
|
||||
const articleBodyHtml = content('.article-content__editor').find('p, figure, h2, .video-container').html();
|
||||
const articleBodyHtml = content('.article-content__editor')
|
||||
.find('p, figure, h2, .video-container')
|
||||
.toArray()
|
||||
.map((e) => content.html(e))
|
||||
.join('');
|
||||
|
||||
item.description = mainImage + articleBodyHtml;
|
||||
item.category = content('meta[name="news_keywords"]').attr('content').split(',');
|
||||
|
|
|
|||
Loading…
Reference in New Issue