How to preserve & in <pre><code>
- by Marcy Sutton
I am having trouble preserving an ampersand in a code example on my blog, because all HTML entities start with &.
Any tips?
For example:
<pre>
<code>
$pageTitle = str_replace('&', ' &', $page->attributes()->title);
</code>
</pre>
Renders as:
$pageTitle = str_replace('&', '&', $page->attributes()->title);