Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Content Formatting

Fabian Lauer edited this page Jun 3, 2016 · 1 revision

Rules for Text, Comment and CDATA Content formatting

Depending on serialisation parameters, text, comment and CDATA content (all of these are simply referred to as 'content' from here on out) differ greatly. Here are the rules by which content is formatted:

1. Preserve Relative Formatting

Apart from indentation and regardless of serialisation parameters, relative formatting is always preserved exactly as authored, for example:

As authored:

Lorem ipsum dolor sit amet,
    consetetur sadipscing elitr.

With highlighted relative formatting:

Lorem ipsum dolor sit amet,
••••consetetur sadipscing elitr.

These 4 spaces are preserved, even when the text is indented:

As authored:

<foo>
    <bar>
        Lorem ipsum dolor sit amet,
            consetetur sadipscing elitr.
    </bar>
</foo>

With highlighted relative formatting:

<foo>
    <bar>
        Lorem ipsum dolor sit amet,
        ••••consetetur sadipscing elitr.
    </bar>
</foo>

Clone this wiki locally