diff options
-rwxr-xr-x | rss.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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): <channel> <title>{feed_data['title']}</title> <link>{feed_data['url']}</link> - <description>{feed_data['description']}</description> + <description>{escape(feed_data['description'])}</description> <lastBuildDate>{_format_date(datetime.now())}</lastBuildDate>""" for item in feed_data["content"]: |