-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML CDATA minify issue #722
Comments
In the general case, XML whitespace should be preserved as it is up to the parser/application to decide if it's significant (e.g. whitespace at the beginning or end of a tag). In most cases it is not significant, much like HTML, which has been the default for the XML minifier. You should enable the |
I've tried KeepWhitespace but it still removes empty spaces at the end of the CDATA content. Can I somehow force this inside of the CDATA? Unfortunately, my parser accepts empty spaces at the end and this is viable for my usecase. |
Do you have a small but complete XML example? This shouldn't happen inside a tag. |
@tdewolff Here, test.xml, test-minify.xml & test-minify-keepwhitespace |
I believe that The The original content between |
I've added a fix that keeps all whitespace inside CDATA as-is. |
Thanks! Two coffees on me ;) |
Awesome, thank you very much!! |
I've released v2.20.36 with this fix! |
Thanks! 🙂 |
<![CDATA[ %d ]]>
where empty space is before and after %d results in " %d" - space after %d is stripped.Can this be improved in the future so CDATA maintains white spaces more properly?
The text was updated successfully, but these errors were encountered: