From e57c35d5bf0ffdc3e68779377b89e076f601dfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Wed, 1 May 2024 09:55:35 +0200 Subject: Escape feed data --- rss.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rss.py b/rss.py index 2f67723..8625c73 100755 --- a/rss.py +++ b/rss.py @@ -66,6 +66,11 @@ class RSSFeed: content: List[RSSItem] +def escape(str): + str = str.replace("&", "&") + return str + + def buildRSS(feed_data: RSSFeed): """ feed_data = { @@ -81,7 +86,7 @@ def buildRSS(feed_data: RSSFeed): {feed_data['title']} {feed_data['url']} - {feed_data['description']} + {escape(feed_data['description'])} {_format_date(datetime.now())}""" for item in feed_data["content"]: -- cgit v1.2.3