This issue remains a problem. I'm using Redmine 2.4.3.stable.
I try to display an XML response in a ticket. I use display my xml message nicely, I use the code class="xml" tag for syntax highlighting and the pre tag to keep the indenting. To do so nicely, I need to put the code tag within the pre tag. If I put the pre tag within the code tag, the code is not highlighted. This works well.
However there is no way to escape the code tag if you want to. Maybe since code is not a Textile tag, there is no way to escape it (using e.g. notextile). With or without the code highlighting, If my message itself contains a code tag, I do not manage to display it correctly.
Example:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<test>
<code>3</code>
<test>
</soapenv:Body>
</soapenv:Envelope>
The problem lies IMHO in the fact that in different libraries/plugins are used (CodeRay & RedCloth/Textile) and Redmine does some patching on it, see in the bottom of formatter.rb .