Hi all,
I’m writing some articles about AJAX, JavaScript, C++, and so on. I have a div class called code that shows and displays everything in a pretty box, fixed font and so on.
The problem is that when I write the code in the TinyMCE, copy and pasting using the "edit HTML" stuff, in this way:
<div class="code">
// Hi all this is code
function myFunction(somethingHere)
{
for (var i = 0; i < 10; i++) {
document.write(i + " ");
}
}
</div>
The problem is that TinyMCE decide to strip all whitespaces and the result is this:
<div class="code">
// Hi all this is code
function myFunction(somethingHere)
{
for (var i = 0; i < 10; i++) {
document.write(i + " ");
}
}
</div>
(and... I’m not mention here... but there’s a problem with the <, that cannot appear in the code!)