RoboHelp is not an HTML editor in the same way as say Dreamweaver. The editor can add processing instructions that tell Rh how to create the output files but those PIs do not get into the help. HTML editors in the general sense have the same code in the source and the output.
That is one reason the editor is different. It also assumes that the majority of users will not have the same HTML skills as someone using say Dreamweaver and it is designed to make some corrections automatically. Sometimes though the result of that is Rh makes changes you don't want.
I'm wondering why you are coding in a text editor though when Rh is designed to write the code for you.
See www.grainge.org for RoboHelp and Authoring tips
As Peter said: this is a known issue. To avoid this, don't open the form in WYSIWYG mode. If you only use HTML mode, it will work fine.
Peter Grainge: I also prefer text editors as they are generally superior to the HTML mode.