Cute editor has an interesting tendency to replace tabs with   (which is the character entitie equivalent of the non-breaking space ( )). This will severely jack up the representation of your html code if you use tabs in the templates.
The fix is to do a simple String.Replace("\t", " ") to replace the tabs with spaces BEFORE sending it to the editor. It's hacky, but it werks :-].