Both rich and plain text editors try to be helpful by adding closing $$ when the user opens latex typing. This should be turned off for the plain text editor, at least, because pasting in a prepared question produces (in the rich text editor) spurious $$ at the ends of lines, or (in the plain text editor) a long string of matching $ at the end of the post.
A user can get open + closing $$ by hitting the LaTeX button; they should not be added to a large amount of text that is pasted in.