Subject: | Tidy4/Tidy5 output parity for the tidyxml command |
Date: | Mon, 20 Jul 2015 21:58:33 -0400 |
To: | bug-EBook-Tools [...] rt.cpan.org |
From: | Jason Unovitch <jason.unovitch [...] gmail.com> |
Greetings,
I propose an addition of the -indent flag to the system_tidy_xml()
subroutine in Tools.pm. My justification for this change is for
behavior compatibility with Tidy 5 (http://www.html-tidy.org/). Tidy 5
will left justify XML output when running `ebook tidyxml
<nameofxml.xml>`. Tidy 4 uses indentation.
This change is effectively a no-op on Tidy4 so I don't see any harm in
adding it for the next release. I've validated the output is identical
given as shown by the MD5 of the output text with this extra flag. This
does however result in a much nicer output with Tidy 5.
# md5 tidy4-*
MD5 (tidy4-indent.xml) = f537d5250208007b7491ed8c6116c66c
MD5 (tidy4-noindent.xml) = f537d5250208007b7491ed8c6116c66c
Comments are appreciated.
Jason
--- lib/EBook/Tools.pm.orig 2014-10-01 22:27:01 UTC
+++ lib/EBook/Tools.pm
@@ -11710,6 +11710,7 @@ Returns the return value from tidy
'-q','-utf8','--tidy-mark','no',
'--wrap','0',
'-xml',
+ '-indent',
'--add-xml-decl','yes',
'-f',$tidyxmlerrors,
'-o',$outfile,