changeset 2192:577e19724744

jp (output xml): remove blank spaces on parsing for better pretty printing
author Goffi <goffi@goffi.org>
date Mon, 13 Mar 2017 23:12:57 +0100
parents a1a8233f89e8
children 33b82250eadd
files frontends/src/jp/output_xml.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/output_xml.py	Sun Mar 12 23:34:51 2017 +0100
+++ b/frontends/src/jp/output_xml.py	Mon Mar 13 23:12:57 2017 +0100
@@ -59,7 +59,8 @@
         return pygments.highlight(xml, lexer, formatter)
 
     def format(self, data, pretty=True):
-        tree = etree.fromstring(data)
+        parser = etree.XMLParser(remove_blank_text=True)
+        tree = etree.fromstring(data, parser)
         xml = etree.tostring(tree, encoding='unicode', pretty_print=pretty)
         return self.colorize(xml)