I am using the features of Django RSS to create an RSS feed. The <description> element of RSS feed elements contains HTML markup. I am currently just embedding HTML markup in the feed using the following template:
{{ obj.post }}
Django, of course, translates special characters ( < , > , & , etc.) into their respective HTML objects.
I know that I can simply output HTML and wrap all the HTML in <![CDATA[...]]> . This page says that any of these methods is acceptable. If true, is there a good reason to choose one method over another? And if I use example # 2, is there a filter for Django to automatically bind HTML text in CDATA tags or do I just need to change my template to:
<![CDATA[ {{ obj.post|safe }} ]]>
Edit
It seems that Django autoescapes are special characters in RSS feeds (or any XML, for that matter) regardless of whether you pass it through the safe filter or not (the problem is discussed in this ticket ). However, general answers are welcome.
html django rss
mipadi
source share