Django syndication: How do I avoid description escaping?

django, django-rss, django-syndication

Solution

How can I avoid this autoescaping?

Actually, you need to keep this auto-escaping... Look carefully at any other rss feeds: xkcd.com/rss.xml

Quote from spec by the RSS Advisory Board:

A channel may contain any number of items. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed; see examples), and the link and title may be omitted. All elements of an item are optional, however at least one of title or description must be present.

http://www.rssboard.org/rss-encoding-examples

Problem

I'm trying to make a webcomic RSS feed with Django, but I can't put an image in the description field, because the html code gets escaped, even if it's in an {% autoescape off %} block. Here is my description template: ``` {% autoescape off %} <img src="{{obj.img.url}}"/> {% endautoescape %} ``` And this is the result: ``` &lt;img src="http://localhost:8000/media/comics/001__.png"/&gt; ``` How can I avoid this autoescaping?

Original source