The problem stems from the fact that HTML source is stored away for use by the editor in a hidden form input tag...
<input type="hidden" value="[HTML Source]">
When this is done, all line feeds and other control characters are lost.
The solution is to use a TEXTAREA tag and set it's visiblity to hidden. Give the TEXTAREA the same id and name as the current INPUT tag, and the editor code will still have access to the HTML source using the value property.
<textarea id="[id]" name="[name]" style="visibility:hidden"> [HTML Source] </textarea>
This will preserve any carriage return and line feed characters in the source HTML and make working with it much easier.