I tend to include a lot of code fragments in my blogs, and I'm particular about the presentation. I finally managed to work out how to get the layout I wanted using a combination of blockquote and code.
Alas, anything contained within
has this very nasty habbit of losing formatting between edits. So, for instance, if I write:
<br /> void<br /> function()<br /> {<br /> ..if ( something )<br /> ....indentedByFourSpaces();<br /> }<br />
("."s to represent spacing that I can't get the post editor to retain)
it will look fine first time around. But if I am using save and continue editing, the formatting has now been deleted so that next time I save it, or if I come back and edit it later, it gets munged down to
void
function()
{
if ( something )
indentedByFourSpaces() ; // LIES!
}
Is there:
a) A way to prevent this formatting loss?
b) A way to enable code and pre tags on the WYSIWYG editor, might make it a lot easier to figure this out.
c) A way to get the code tag to include pre like code tags everywhere else in the universe? I feel dirty marking code up with pre instead of code.