Skip to content

Commit

Permalink
fix: rss titles not to include code tags (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrey <[email protected]>
  • Loading branch information
codenomnom and codenomnom authored Oct 4, 2024
1 parent f4722b4 commit db2a0ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { APIContext } from 'astro';
import rss from '@astrojs/rss';
import MarkdownIt from 'markdown-it';
import type { APIContext } from 'astro';
import sanitizeHtml from 'sanitize-html';

import { stripCodeTag } from '../utils';
import { getAllPosts } from '../content/config';

const parser = new MarkdownIt();
Expand All @@ -18,7 +20,7 @@ export async function GET(context: APIContext) {
stylesheet: '/rss/pretty-feed-v3.xsl',
items: posts.map((post) => (
{
title: post.data.title,
title: stripCodeTag(post.data.title),
pubDate: post.data.date,
description: post.data.description,
link: `/quirks/${post.slug}`, // IMPORTANT: make sure to update if changing the url
Expand Down

0 comments on commit db2a0ac

Please sign in to comment.