allow CDATA content to go to RSS description

This allows feed entry `content` specified with `type="CDATA"` to be translated to RSS description with CDATA specified
This commit is contained in:
daryl herzmann 2018-07-07 21:27:22 -05:00 committed by GitHub
parent 9da6b17ca2
commit cfaeb68898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,7 +206,9 @@ class FeedEntry(object):
description.text = self.__rss_description
elif self.__rss_content:
description = etree.SubElement(entry, 'description')
description.text = self.__rss_content['content']
description.text = etree.CDATA(self.__rss_content['content']) \
if self.__rss_content.get('type', '') == 'CDATA' \
else self.__rss_content['content']
for a in self.__rss_author or []:
author = etree.SubElement(entry, 'author')
author.text = a