Surrounding white space in some elements may be desired. Like in scripts or other file content. Be more careful when removing it.
The catch
The AutoYaST profile is processed by YaST to construct the final profile. It's written, modified by scripts, then read again, for example. Ensure that during this processing the CDATA 'attribute' to elements is not lost.
Solution
Strip leading white space when reading XML CDATA blocks. And create CDATA blocks when generating XML if an element contains trailing white space.
Coverage decreased (-0.02%) to 40.555% when pulling 59b960c0d1f9b472462cdb20b26ecedbae781507 on sw_10 into c762c93ffee7338dc515f2cedd1996d28e2a1fd8 on SLE-15-SP3.
Task
Surrounding white space in some elements may be desired. Like in scripts or other file content. Be more careful when removing it.
The catch
The AutoYaST profile is processed by YaST to construct the final profile. It's written, modified by scripts, then read again, for example. Ensure that during this processing the CDATA 'attribute' to elements is not lost.
Solution
Strip leading white space when reading XML CDATA blocks. And create CDATA blocks when generating XML if an element contains trailing white space.
Note
Why not also keeping leading white space? - It's common to have a leading newline in
script
sections. They must be removed. See https://doc.opensuse.org/projects/autoyast/#id-1.9.4.2.4.5 for an example.Note 2
On closer inspection, in SLE12 leading white space is preserved. And it causes no issues. Hm.