Fix template element '{content}'.

This was the same as '{summary}' and needs more attention, too.
This commit is contained in:
Hartmut Goebel
2019-04-23 22:05:53 +02:00
parent 7a5b30aeef
commit e41073efbc

View File

@ -169,7 +169,9 @@ def get_entry(entry, include_images, generator=None):
for t in tag['term'].split():
hashtags.append('#' + t)
summary = entry.get('summary', '')
content = entry.get('content', '')
content = entry.get('content', '') or ''
if content:
content = content[0].get('value', '')
url = entry.id
if generator == "wordpress":
links = [l for l in entry.links if l.get("rel") == "alternate"]
@ -181,7 +183,7 @@ def get_entry(entry, include_images, generator=None):
'url': url,
'title': BeautifulSoup(entry.title, 'html.parser').get_text(),
'summary': BeautifulSoup(summary, 'html.parser').get_text(),
'content': BeautifulSoup(summary, 'html.parser').get_text(),
'content': BeautifulSoup(content, 'html.parser').get_text(),
'hashtags': ' '.join(hashtags),
'updated': dateutil.parser.parse(entry['updated']),
'images': collect_images(entry, generator) if include_images else [],