fix: GitHub markdown with empty body (#5312)

Close #5299
This commit is contained in:
Henry Wang
2020-07-31 17:13:06 +01:00
committed by GitHub
parent 7cb6c8d30d
commit 745f516663
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ module.exports = async (ctx) => {
.filter((item) => item.pull_request === undefined)
.map((item) => ({
title: item.title,
description: md.render(item.body) || 'No description',
description: item.body ? md.render(item.body) : 'No description',
pubDate: new Date(item.created_at).toUTCString(),
author: item.user.login,
link: `${host}/${item.number}`,

View File

@@ -33,7 +33,7 @@ module.exports = async (ctx) => {
link: host,
item: data.map((item) => ({
title: item.title,
description: md.render(item.body) || 'No description',
description: item.body ? md.render(item.body) : 'No description',
pubDate: new Date(item.created_at).toUTCString(),
link: `${link}/${item.number}`,
})),