There are several major aspects of white-space handling in the oXygen Author editor when opening documents or switching to Author mode, saving documents or switching from Author mode to another one and editing documents.
When deciding if the white-spaces from a text node are to be preserved, normalized or stripped, the following rules apply:
If the text node is inside an element context where the xml:space="preserve" is set then the white-spaces are preserved.
If the CSS property white-space is set to "pre" for the node style then the white-spaces are preserved.
If the text node contains other non-white-space characters then the white-spaces are normalized.
If the text node contains only white-spaces:
If the node has a parent element with the CSS display property set to inline then the white-spaces are normalized.
If the left or right sibling is an element with the CSS display property set to inline then the white-spaces are normalized.
If one of its ancestors is an element with the CSS display property set to table then the white-spaces are striped.
Otherwise the white-spaces are ignored.
The Author editor will try to format and indent the document while following the white-space handling rules:
If text nodes are inside an element context where the xml:space="preserve" is set then the white-spaces are written without modifications.
If the CSS property white-space is set to "pre" for the node style then the white-spaces are written without any changes.
In other cases the text nodes are wrapped.
Also, when formatting and indenting an element that is not in a space-preserve context, additional Line Separators and white-spaces are added as follows:
Before a text node that starts with a white-space.
After a text node that ends with a white-space.
Before and after CSS block nodes.
If the current node has an ancestor that is a CSS table element.
You can insert space characters in any text nodes. Line breaks are permitted only in space-preserve elements.
CDATA sections, comments, processing instructions have by default the white-space CSS property set to "pre" unless overridden in the CSS file you are using. Also they are considered to be block nodes.