I have that same problem. I am using v2.2. I found a way to work around that. What you may try, as it worked for me, is… When you paste the code into the text editor do not click back on the visual tab before saving.
Hope that works for you also.
If you found a fix for it let me know.
Jeff