Closed Bug 86573 Opened 24 years ago Closed 24 years ago

Mozilla rendering <br> inside <listing> as an additional line break

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: kousik, Assigned: asa)

Details

Attachments

(1 file)

If there is a <br> tag inside a <listing> tag, mozilla inserts a blank line when NS4 or IE5 doesn't. For example if the source is: <html> <body> <listing> <br>int main(int ac, char **av) <br>{ <br> printf("\n"); <br>} </listing> </body> </html> Mozilla shows it as: int main(int ac, char **av) { printf("\n"); } Whereas NS4 or IE5 shows: int main(int ac, char **av) { printf("\n"); } Who is correct? I guess mozilla, coz putting a line-break when you see a <br> makes sense; but is it not the case that we ignore these tags when we're in <listing> ?
The listing tag isn't in the html 4 speicification. You should use the code tag instead, which is in the html 4 specification. br tags inside the code tag are displayed as you expect. Marking as INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
But <CODE> destroys all the indentation! It shows int main(int ac, char **av) { printf("\n"); } Leading spaces need be preserved :-(
What about using PRE ?
It may not be included in HTML 4.0, but it was included in 3.2 as depreciated. It's arguable whether Mozilla should support it. Here's a page that describes the listing tag: http://www.blooberry.com/indexdot/html/tagpages/l/listing.htm The best bet is to use a combination of <code> and <pre> to get similar appearance. Unfortunately, this may not render quite the same (listing was supposed to support 132 character lines), but you can probably come close.
The HTML 4.01 spec says Listing is obsolete and should be replaced with PRE. http://www.w3.org/TR/html401/appendix/changes.html#h-A.3.1.3 It appears that Mozilla behaves a bit strangely with PRE tags. Previous browsers including Nav 4.x seem to ignore BR tags inside PRE. Mozilla renders them as linebreaks.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: