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.
Coverage increased (+0.006%) to 41.638% when pulling 6151ff4a3267643dbd7d58ac29c50b2a00eea566 on sw_10 into 6b08011b27346a4364da8d05ed1c2697a2868b90 on master.
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.