I have had problems with this in the past, wordpress does some auto formatting when you save it. I cant remember what solution I used to fix it but I have found some solution for you to try
It looks like they work with wordpress 2 not sure about 3.
One thing that you should do is deactivate the visual editor as I remember that making life much better. Just use the code view. You should be able to deactivate the visual editor in 'Users Personal Options'.