I frequently post pages with code examples. However, WordPress strips out whitespace, thus ruining the indentation and formatting of my code. So this:
<pre>
selector {
property: value;
property: value;
}
</pre>
becomes this:
selector {property: value;property: value;}
I found the Raw HTML plugin, which fixes linebreaks, but even with Raw HTML, the spaces aren’t preserved, so it looks like this:
selector { property: value; property: value; }
I also have played with the Preserved HTML Editor Markup plugin, but it does not support <pre>
or <code>
tags, which is exactly where I need it. How can I preserve multiple contiguous spaces?
Edit: Just to clarify, the white space is stripped out by WordPress before it is sent to the browser: viewing the source code reveals that the spaces have been collapsed.