Closed Chris2011 closed 4 years ago
I expected this output:
<?xml version="1.0" encoding="UTF-8"?><project name="org.chrisle.netbeans.plugins.adobeextensionbuilder" default="netbeans" basedir="."><description>Builds, tests, and runs the project org.chrisle.netbeans.plugins.adobeextensionbuilder.</description><import file="nbproject/build-impl.xml"/></project>
Hey @Chris2011, good catch! The XML prolog is (rightfully) NOT considered a tag by minify-xml
. Thus it is not minified, but I can see why the removeWhitespaceBetweenTags
option is supposed to be removing that space as well! I'll have to add some special logic for optimizing the prolog and document type! Let me do that tomorrow!
I understand, you are right. It is just not a "normal" tag somehow :).
This one was considerably harder to fix than I expected. 👍 Done with 2.4.0. Prolog & document type declaration will now also be minified. removeWhitespaceBetweenTags
now has three possible values:
true
: Remove all whitespace between tags and tag-like elements, like doctype, prolog, etc."strict"
: Works like before and only removes whitespace between XML tags like <ok> <ok>
false
: Remove no whitespace between tags
Hope this helps! Default is true, so you should be able to call the CLI without any arguments, to get the default values applied.
Great, thx will test it soon :)
I tried the latest version 2.3.1 and used it like this:
minify-xml foo.xml -o foo.min.xml --remove-whitespace-between-tags true
This is my input file: https://pastebin.com/Dighb1Ek and this is my output file: https://pastebin.com/wLEr6w79
As you can see, it was minified, and the comments were removed, but the problem is that the space is still there. So I thought the flag
--remove-whitespace-between-tags true
will fix this but no. Did I miss a flag for this?