diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index 2b733f4b..6afa5cde 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -15,12 +15,15 @@ export async function GET(context: APIContext) { description: siteConfig.subtitle || 'No description', site: context.site ?? 'https://fuwari.vercel.app', items: blog.map(post => { + const content = + typeof post.body === 'string' ? post.body : String(post.body || '') + return { title: post.data.title, pubDate: post.data.published, description: post.data.description || '', link: `/posts/${post.slug}/`, - content: sanitizeHtml(parser.render(post.body), { + content: sanitizeHtml(parser.render(content), { allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']), }), }