XML pretty-print in separate option

Who reads plain XML anyway?
This commit is contained in:
2015-02-20 17:38:39 +08:00
parent fcf4197801
commit ef946c0712
3 changed files with 7 additions and 4 deletions

View File

@@ -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):