Forum Settings
       
« Previous 0 Next »
Reply To Thread

Bug with [pre] tagsFollow

#1 Mar 17 2004 at 9:29 AM Rating: Good
**
385 posts
There is a possible bug with how Mozilla displays message board messages with the [ pre ] tags. I'm viewing the HTML generated by these tags, and it appears that you're more or less directly translating them into HTML <pre></pre> tags.

This is causing a conflict with the automatic <br> insertion you do at each line. By definition, anything inside <pre> tags is preformatted, so line breaks in the text are already treated as <br> tags by the browser. However, your parser is also including a <br> tag at the start of any line, including those inside [ pre ] tags. This causes anything inside [ pre ] tags to appear double spaced in Mozilla. Here's what I mean.

I will use the following text as a demo:
[ quote ][ pre ]line 1
line 2
line 3
line 4[ /pre ][ /quote ]

Result:
Quote:
line 1 
line 2 
line 3 
line 4


The HTML generated by this looks like so:
Quote:
<br><BLOCKQUOTE><b id=fs8>Quote:</b><hr size=1><pre>line 1 
<br>line 2 
<br>line 3 
<br>line 4</pre><hr size=1></BLOCKQUOTE>


IE will ignore the BR tags. Mozilla will interpret them literally, though, and cause the output to appear double spaced.

The solution is to not insert BR tags when processing text inside [ pre ] tags. Both IE and Mozilla will then read the hard line breaks correctly and display the output correctly.

For a demonstration, copy this next block into a file on your hard disk and load it in both IE and Mozilla. You'll see the difference at once.

Quote:
<html>
<body>
<p>without BR:</p>
<pre>
line 1
line 2
line 3
line 4</pre>

<p>with BR:</p>
<pre>
<br>line 1
<br>line 2
<br>line 3
<br>line 4</pre>
</body>
</html>


My browsers are Mozilla 1.6 and IE 6.01.
____________________________
--
Sir KyrosKrane Sylvanblade
Luclin (Veeshan) Server
Lord, Lightbringer, and Redeemer in the service of Erollisi Marr
Master Artisan (300 + GM Trophy in All)
Master Fisherman (200 + 5%) and maybe Master Drunk (2xx + 20%, too drunk to tell!)
« Previous 0 Next »
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 163 All times are in CST
Anonymous Guests (163)