Ticket #11705: atom_title.diff

File atom_title.diff, 1.3 KB (added by notanumber, 6 years ago)

Patch to extend Atom1Feed to include "html" atribute in title

  • site/src/django-1.0.2-1.0.4FINAL/django/utils/feedgenerator.py

    diff --git a/site/src/django-1.0.2-1.0.4FINAL/django/utils/feedgenerator.py b/site/src/django-1.0.2-1.0.4FINAL/django/utils/feedgenerator.py
    index de924a3..eeff176 100644
    a b class Atom1Feed(SyndicationFeed): 
    276276            return {u"xmlns": self.ns}
    277277
    278278    def add_root_elements(self, handler):
    279         handler.addQuickElement(u"title", self.feed['title'])
     279        handler.addQuickElement(u"title", self.feed['title'], {u"type": u"html"})
    280280        handler.addQuickElement(u"link", "", {u"rel": u"alternate", u"href": self.feed['link']})
    281281        if self.feed['feed_url'] is not None:
    282282            handler.addQuickElement(u"link", "", {u"rel": u"self", u"href": self.feed['feed_url']})
    class Atom1Feed(SyndicationFeed): 
    304304            handler.endElement(u"entry")
    305305
    306306    def add_item_elements(self, handler, item):
    307         handler.addQuickElement(u"title", item['title'])
     307        handler.addQuickElement(u"title", item['title'], {u"type": u"html"})
    308308        handler.addQuickElement(u"link", u"", {u"href": item['link'], u"rel": u"alternate"})
    309309        if item['pubdate'] is not None:
    310310            handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('utf-8'))
Back to Top