We have moved to GitHub Issues
Created by Bart ten Velde 02 Jul 2015, 15:24:02 Updated by Chriztian Steinmeier 06 Jul 2015, 17:09:24
Hi, using multiple lines in a "textbox multiple" property results in linebreak as '\n' after save & publish and changes to '\r\n' after a right click on 'content' and choose 'Republish entire site'.
So when value is read back from database (republish entire site) we get the CRLF.
When we serialize, ContentXmlEntity.Xml is an XElement and the value has LF. Then we do .ToString(SaveOptions.None) and the value has CRLF. As per MSDN, None means "Format (indent) the XML while serializing." and that seem to include the CDATA content, whereas DisableFormatting would "Preserve all insignificant white space while serializing.".
If we want to respect whatever white spaces are in the content of a property, then we should use DisableFormatting.
Notes: DisableFormatting does not change anything, if XElement value contains LF then ToString turns it into CRLF. Need another solution...
Looks like there is no way to get ToString() to produce the string we want, had to resort to an XmlWriter with specific settings, so the CR and LF in the original data string are preserved. So now what we get in the cache after a full reload is identical to what was in the cache originally.
This is 39a9d68f4304c1101b491e63f997502d7d8b356d
Cool - nice work!
Backwards Compatible: True
Affected versions: 7.1.8, 7.2.6
Due in version: 7.3.0