Here's a couple of tests which cover the indentation problems I've encountered
Multiple & nbsp; elements - followed by text and text in a strong tag
The count of nbsp before this line: 0
The count of nbsp before this line: 3
The count of nbsp before this line: 6
<pre>
The count of whitespace before this line: 0
The count of whitespace before this line: 3
The count of whitespace before this line: 6
<div style="white-space: pre;">
The count of whitespace before this line: 0
The count of whitespace before this line: 3
The count of whitespace before this line: 6