CODE directive, single-lined?

I thought I’d asked this question before, but I can’t find it when I search this Forum, so I guess I DIDN’T ask this question before.

To wit:

When I use the {CODE} vB command (using square brackets instead of curly braces, of course), everything between it and the following {/CODE} command is DOUBLE SPACED, i.e. with a blank line between each line, like this:


line 1
line 2
line 3

Is there a way to make the CODE command display things as SINGLE spaced, without the blank line in between each entry? It would be VERY useful for doing ASCII-art diagrams of organic chemicals.

Your post is single spaced on my screen.
I’m using IE5.5 on a 1024x768 setting.

Anyone else see double spacing there? What are you running?

Yes, I see the extra blanks lines. The problem is a combination of the way vB translates [code][/code] tags into <pre>,</pre> (preformatted text) tags. Instead of accepting the data as type, vB adds a <br> tag between each line. When Netscape lays out the page, it see the carriage return at the end of the line as one line break and the <br> as a 2nd one. When IE lays it out, it ignores the <br> tag completely.

Which is “right”, I don’t know. They both execute <font> tag inside the <pre> tags, but only Netscape executes the <br> tag.

Really, though, the <br> tag shouldn’t be there in the first place. I don’t think Jelsoft (makers of vBulletin) even bothers to check their code with Netscape.

Jim

I am also using IE 5.5 on 1024x768. It is double spaced for me.

That’s interesting. I have Netscape 4.74 and IE 5.0 and Netscape is double spaced and IE is single spaced, no matter what screen resolution I use.

Wonder what the different is.

Jim

I, too, am running Netscape 4.7, and it’s double-spaced for me.
I’ve also noticed the following anomaly in Netscape 4.7:

If I post a {/b} or a {/i} directive that doesn’t come after a corresponding {b} or {i}, Netscape 4.7 displays the rest of the message in a Times Roman font, but IE 5.x keeps using the same (sans sarif) font that the rest of the message was in. Viz:

This sentence is in the normal font.
*In a Netscape browser, this sentence is in Times Roman.

I just looked at the HTML generated by the {CODE} directive, and I think I know why it’s appearing double-spaced in my browser.

The HTML looks like this:

<pre>
line 1
<br>
line 2
<br>
line 3
</pre>

Those <br> tags should not be there. Everything between the <pre> and </pre> tags is automatically displayed exactly as it’s written, with separate lines preserved. <br> within a <pre> block is totally unnecessary.