From cfaeb6889899b9622af72dd9d839950821feb164 Mon Sep 17 00:00:00 2001 From: daryl herzmann Date: Sat, 7 Jul 2018 21:27:22 -0500 Subject: [PATCH] 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 --- feedgen/entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feedgen/entry.py b/feedgen/entry.py index a97758e..c6080cd 100644 --- a/feedgen/entry.py +++ b/feedgen/entry.py @@ -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