diff options
author | André Glüpker <git@wgmd.de> | 2024-05-01 09:55:35 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2024-05-01 09:55:35 +0200 |
commit | e57c35d5bf0ffdc3e68779377b89e076f601dfb9 (patch) | |
tree | a4cc342abdcd7766f9ae08dc2fce3c8a12491b48 /rss.py | |
parent | 0be5fb4468df0c158ec0ec5da460f7b6d67cfb71 (diff) | |
download | rss-feeds-e57c35d5bf0ffdc3e68779377b89e076f601dfb9.tar.gz rss-feeds-e57c35d5bf0ffdc3e68779377b89e076f601dfb9.tar.bz2 rss-feeds-e57c35d5bf0ffdc3e68779377b89e076f601dfb9.zip |
Escape feed data
Diffstat (limited to 'rss.py')
-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"]: |