From e93eb3d9714be0b489891f4d2da41bb4df4978a5 Mon Sep 17 00:00:00 2001 From: Mohammadreza Varasteh Date: Wed, 26 May 2021 21:51:19 +0430 Subject: Fixed #32789 -- Made feeds emit elements with no content as self-closing tags. --- django/utils/feedgenerator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django/utils') diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index 24b2d1d172..50ede4dd21 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -187,7 +187,7 @@ class RssFeed(SyndicationFeed): content_type = 'application/rss+xml; charset=utf-8' def write(self, outfile, encoding): - handler = SimplerXMLGenerator(outfile, encoding) + handler = SimplerXMLGenerator(outfile, encoding, short_empty_elements=True) handler.startDocument() handler.startElement("rss", self.rss_attributes()) handler.startElement("channel", self.root_attributes()) @@ -296,7 +296,7 @@ class Atom1Feed(SyndicationFeed): ns = "http://www.w3.org/2005/Atom" def write(self, outfile, encoding): - handler = SimplerXMLGenerator(outfile, encoding) + handler = SimplerXMLGenerator(outfile, encoding, short_empty_elements=True) handler.startDocument() handler.startElement('feed', self.root_attributes()) self.add_root_elements(handler) -- cgit v1.3