summaryrefslogtreecommitdiff
path: root/django/utils/feedgenerator.py
diff options
context:
space:
mode:
authorMohammadreza Varasteh <varastehmr@gmail.com>2021-05-26 21:51:19 +0430
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-05-27 21:05:28 +0200
commite93eb3d9714be0b489891f4d2da41bb4df4978a5 (patch)
tree09b55157906f6f019d412d28809ea5383bb82ce3 /django/utils/feedgenerator.py
parent02c59b7a4355fda8c99224b5de9c0a3929bffe22 (diff)
Fixed #32789 -- Made feeds emit elements with no content as self-closing tags.
Diffstat (limited to 'django/utils/feedgenerator.py')
-rw-r--r--django/utils/feedgenerator.py4
1 files changed, 2 insertions, 2 deletions
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)