Forum Problem with <code> Tag
I used the following text in another post, and it seemed to close my "code" tag prematurely, leaving the second chunk in a regular non-code font/style. (I have replaced each of the code tag's angle brackets with square brackets so they are not parsed out by the editor.)
[code]
int a = 5;
int b = 6;
// Commence the swapping!
a = a + b; // a will now equal 11, b will stay at 6
b = a - b; // a stays at 11, b becomes 5
a = a - b; // a now equals 6, b stays at 5
[/code]
use < and > around code instead of [ and ]
echo "test";
Mssr Speed:
I imagine you looked at my example and not my explanation, yes?
One line works, two lines separated by a space does not:
--------------
<code>echo "test";
echo "test 2";</code>
--------------
becomes...
--------------
echo "test";
echo "test 2";
--------------
i.e. Certain whitespace breaks the <code> tag.
Mssr Hankinson:
Hrmm...if it's busted, would it be better to remove <code> from the "Allowed HTML tags" list? I wonder if the others break in the same way.
Here is Google link that
should span multiple lines
Seems your parser regards a blank line as a break in the current tag/phrase. Multiple lines in a row with no blank lines in between have no problems, however.
Sorry I tend to skim over things too quickly sometimes, we will add this to our to-do list I'd like to add code tags with full syntax highlighting.
Hey our forums currently don't support the code function. But they definitely should. Will add this on our list of things to do.
Developer - Compilr.com