Hi faced this error many times but was unable to analyzed the root cause of problem.
Whenever i embedded the code in my blog and come back to edit, sometime the wordpress editor discarded my code. It was not always but often.
How to reproduce the error ?
- Go to HTML tab and embed few html code. i am using syntaxhighlighter, so my code is normally like enclosed in square bracket with text “sourcecode”. Go to Visual Tab it works fine.
- Again go to HTML tab , save your article and close the window. (Remember you are closing the window when you are on HTML tab).
- Now come to your post and navigate to “Visual” tab. you will notice that your HTML code is discarded. Don’t save anything.
- Close the window again. (Remember, this time you are closing the window while you was on “Visual” tab.)
- Come back again to your post and you will see that your code is just fine.
If you close your window while you are in “HTML” tab, next time when you will come back it opens the code in same tab (“HTML”) by default and when you switch to “Visual” tab it discards the html code. So to avoid this problem, always close your window when you will be in “Visual” tab.