For anyone else with this problem, I found a solution.
It requires modifying any of the GeSHi syntax files you use, as well as geshi.php.
In geshi.php, find the line that contains function hsc(...) {
. Comment out the following lines:
'&' => '&',
';' => '<SEMI>',
Then, you need to go into each syntax/language PHP file, and in the SYMBOLS
array change &
to &
, <
to & gt;
(no space, though), and >
to & lt;
. Then go down to the end and, if your chosen language uses < and > brackets to delimit code, change those to their HTML counterparts anywhere in the SCRIPT_DELIMITERS
array.
Now, when you paste your markup into the WYSIWYG editor, TinyMCE will appropriately convert your < and > to HTML code, and your markup won’t be messed up when switching between WYSIWYG and HTML source views.