Commit 37bcbcf
Changed files (1)
src
pages
src/pages/rss.xml.ts
@@ -2,11 +2,8 @@ import { siteConfig } from '@/config';
import rss from '@astrojs/rss';
import { getSortedPosts } from '@utils/content-utils';
import type { APIRoute } from 'astro';
-import MarkdownIt from 'markdown-it';
import sanitizeHtml from 'sanitize-html';
-const parser = new MarkdownIt();
-
export const GET: APIRoute = async function (context) {
const posts = await getSortedPosts();
return rss({
@@ -18,9 +15,7 @@ export const GET: APIRoute = async function (context) {
pubDate: post.data.published,
description: post.data.description,
link: `/posts/${post.data.slug}`,
- content: sanitizeHtml(parser.render(post.body || ''), {
- allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']),
- }),
+ content: sanitizeHtml(post.rendered?.html || ''),
})),
});
};