Let's start with a simple text.

The ships hung in the sky, much the way that bricks don't.

This should be ignored
A1 A2 A3
B1 B2 B3 B 4

This is some text with inline elements and HTML entities (>bla<)

Test
a
few
line
breaks
Spaces in an inline text should be completely ignored.
But,
    a pre-formatted
                block  should  be  kept
                                       pre-formatted.
These special elements SHOULD NOT BE CONVERTED. This should be skipped too. The Greatest Science Fiction Quotes Of All Time

Don't know, I don't know such stuff. I just do eyes, ju-, ju-, just eyes... just genetic design, just eyes. You Nexus, huh? I design your eyes.