Surrounding white space in some elements may be desired. Like in scripts or other file content.
Solution
Do not strip surrounding white space when reading XML CDATA elements. And create CDATA elements when generating XML if an element contains surrounding white space.
I did some checks and prior to SLE15-SP3 we did preserve all white space in CDATA elements. This also does not pose a problem in script elements. Leading white space is ok there.
So, this pull request fully restores the old behavior.
Coverage remained the same at 40.555% when pulling 74b6f7a8bfe39aad105cb8472d7c3028e97cd930 on sw_11 into 81558cb5e8ff66b9c5ff1d7473bbce43048e4b1e on SLE-15-SP3.
Task
Surrounding white space in some elements may be desired. Like in scripts or other file content.
Solution
Do not strip surrounding white space when reading XML CDATA elements. And create CDATA elements when generating XML if an element contains surrounding white space.
Note
This reworks https://github.com/yast/yast-yast2/pull/1243.
I did some checks and prior to SLE15-SP3 we did preserve all white space in CDATA elements. This also does not pose a problem in script elements. Leading white space is ok there.
So, this pull request fully restores the old behavior.