I am having the same problems, it’s really annoying; even using a code formatter plugin doesn’t help, WordPress won’t leave code alone even if it’s:
1. embedded in code tags
2. embedded in pre tags
3. embedded in code tags provided by a code-formatter plugin
Any solutions? ^^
Regards,
Matthias