Here’s a code example with <pre> tags around it. There should be extra spacing between the query and the result than the two lines of the query.
SELECT 'Spiders are deadly'
FROM DUAL;
Spiders are deadly
And here is the entire HTML fragment from above
<p>Here’s a code example with <pre> tags around it. There should be extra spacing between the query and the result than the two lines of the query.</p><pre>SELECT ‘Spiders are deadly'<br />FROM DUAL;<br /><br />Spiders are deadly</pre><p><br /> </p><p />
And here’s a try without using line breaks at all, but having them in the text itself
SELECT 'Spiders are deadly' FROM DUAL; Spiders are deadly
Which I now realise is the way to go. It’ll just mean me switching back and forwards between wysiwyg editing and the HTML window. Not too hard but I won’t be fixing up all of the old blogs
Doug,
You could hack this so that you can enter the html “incorrectly” [i.e. using tags inside the tag] and then use a piece of javascript to fix it up on page load. Off the top of my head, something along the lines of
//find all pre tags in the document
var pretags = document.getElementsByTagName(“PRE”);
//replace any br tag inside it with a newline
for(i=0; i
Bugger. Javascript seems to break the comments! That should have said “using <BR/> tags inside the <pre> tag” and the javascript should have been
var pretags = document.getElementsByTagName(“PRE”);
for(i=0; i<pretags.length; i++){
pretags[i].innerHTML = pretags[i].innerHTML.replace(‘<br/>’,’\n’);
}
Thanks for the tip. Seems a bit too technical for me, though!
😉
Me too .. I understood all of that up to “Bugger”.
I notice in your stylesheet it says
#content pre {
font-family: Lucida Console, fixed;
…
“fixed” isn’t a font family – it should be “monospace”. Currently I don’t see a monospace font on Apple Mac because I don’t have Lucida Console.
How’s that?
>> on Apple Mac
Now, *that* explains a lot 😉
Developers … sheesh!