XML pretty-print in separate option
Who reads plain XML anyway?
This commit is contained in:
@@ -361,7 +361,7 @@ class FeedParser(FeedBase):
|
||||
items = FeedListDescriptor('items')
|
||||
|
||||
def tostring(self, **k):
|
||||
return etree.tostring(self.xml.getroottree(), pretty_print=True, **k)
|
||||
return etree.tostring(self.xml.getroottree(), **k)
|
||||
|
||||
def tojson(self, indent=None):
|
||||
return json.dumps(OrderedDict(self), indent=indent)
|
||||
|
@@ -631,7 +631,10 @@ def Format(rss, options):
|
||||
elif options.reader:
|
||||
return rss.tohtml()
|
||||
else:
|
||||
return rss.tostring(xml_declaration=True, encoding='UTF-8')
|
||||
if options.indent:
|
||||
return rss.tostring(xml_declaration=True, encoding='UTF-8', pretty_print=True)
|
||||
else:
|
||||
return rss.tostring(xml_declaration=True, encoding='UTF-8')
|
||||
|
||||
|
||||
def process(url, cache=None, options=None):
|
||||
|
Reference in New Issue
Block a user