The source code highlighting was probably the first feature I was missing in WordPress. I briefly googled my options and decided it would be quicker to add the missing feature myself, since it looked pretty straightforward.
So what I did:
1. I added a hilite() function in functions-formatting.php
$text = str_replace('<? php', '<?php', $text);
'return highlight_string($matches, true); '
The first line of the function is pretty curious, I agree. I needed it because I noticed that WP is adding a space between
? before saving to the database.
2. I added call to the new function in default-filters.php
... just before this line
And it worked! Only that the highlighting itself for some reason is using the HTML font tag (God forbid!), but I believe that's server setup.
I added the filter to one more place in default-filters.php, in order to highlight source code when listing excerpts, for example category listing on an archive listing. So default-filters.php looks more like: