I'm using PyRSS2Gen to generate an RSS feed. I've succeeded in extending it to add an extra element to each item in the RSS feed:
def __init__(self, **kwargs):
if 'content' in kwargs:
self.content = kwargs['content']
self.content = None
def publish_extensions(self, handler):
PyRSS2Gen._opt_element(handler, "content:encoded", '<![CDATA[' + self.content + ']]>')
However, self.content contains HTML tags and all of the angled brackets (including those in the <![CDATA part) are translated into < and > when the feed file is generated.
How do I add an extra RSS item element that contains HTML using PyRSS2Gen?
I eventually ditched the idea of using the CDATA wrapper and just had the full text be encoded. Seems to work.