There are several major aspects of white-space handling in the Oxygen Author editor which are important
in the following cases:
when opening documents
when switching from other editing mode to Author mode
when saving documents in Author mode
when switching from Author mode to another one
Open 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.
Save documents - 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.
Editing documents - You can insert space characters in any text nodes. Line breaks
are permitted only in space-preserve elements. Tabs are marked in the space-preserve
elements with a little marker.