Newlines are replaced by spaces

Here, try checking the comment in Set XML Attribute in this Block Export. I'm trying to make it happen to options but I don't know what triggers it. Selecting everything in the comments and doing a string comparison says it is the same thing, so it is just not registering the newlines as being actual newlines.

Found the error I believe. Someone is not correctly escaping/encoding or parsing newlines.



Make 100% sure that your function is correctly escaping all line breaks!!

And also make 100% sure that if you are reading an XML file with line breaks like these, that when you copy the text over, you update them to use the correct line break character beforehand (
) instead of only when they type something in. 
 also seems like a carriage return \r which is kind of interesting that it isn't 
 (a newline \n), but both need to be handled!

Also, it appears that this character is a carriage return that was improperly handled?

This appears to be an oversight issue so hopefully it should be rather easy to fix, but I am not really sure how nobody has spotted this yet.

Here's some example files created using python to break it because I am not sure what exactly causes it to do this improperly.
Fixed
Broken

Thanks @wunder_wulfe,

and I'm sorry about this issue and I'll try to see it again (checking all our format functions (trimming, escaping...) , but you know this is not new (see our last November posts and the problem is not the XML (yes, we already saw then the problem of the returnCarriage or other control charst). The problem is what is their origin... I am not yet able to reproduce it.

What I mean is we can improve our functions, but maybe the cause is not Snap!

Because if somebody import a project modified by a text editor (maybe with unconscious changes, because that editor makes automatic changes on codification or indentation ...) or somebody drag and drop text from outside...
Then, we cannot control every possible scenario.
Codification changes (utf-8, iso..), strange characters... See for example this issue caused by a drag and drop action.

I continue, but if anybody could report som reproducible example (steps to cause the problem), and we can confirm it is not caused by a XML edition or a drag and drop action... it will help a lot.

Joan

It is very odd because I can't remember doing anything at all to my project aside from export and import XML into it, but once it infects the project, it will infect all other things inside of it when it is saved or exported. Maybe it randomly happens only when I don't want it to happen so I will try and break it on purpose and see how I could potentially poison inputs.