fixes a crash reported by Xavier Maillard for RSS feeds without link elemnet

This commit is contained in:
Ploum 2023-10-01 14:04:17 +02:00
parent eeae7e3ad7
commit 4892b9e450
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Changes since beta1
- fixes gophermap being considered as gemtext files
- fixes opening mailto links
- fixes existing non-html ressources marked a to_fetch even when not needed (simple and/or confusion)
- fixes a crash with RSSfeeds without <link> element
- attempt at hiding XMLparsedAsHTMLWarning from BS4 library
- chafa now used by default everywhere if version > 1.10
- ignoring encoding error in ansicat

View File

@ -860,7 +860,10 @@ class FeedRenderer(GemtextRenderer):
self.validity = False
postslist = ""
for i in parsed.entries:
line = "=> %s " %i.link
if "link" in i:
line = "=> %s " %i.link
else:
line = "* "
if "published" in i:
pub_date = time.strftime("%Y-%m-%d",i.published_parsed)
line += pub_date + " : "