multi-line code examples render as one long line

RESOLVED FIXED

Status

www.mozilla.org
General
RESOLVED FIXED
14 years ago
5 years ago

People

(Reporter: skierpage, Assigned: Dawn Endico)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7b) Gecko/20040316
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7b) Gecko/20040316

On this URL ("Using the Mozilla JavaScript interface to XSL Transformations"),
the second code example starting "var testTransform =..." and the later example
starting "var ownerDocument =..." both appear as one long line, even though in
HTML source they are on multiple lines.  This happens in Mozilla 1.7b Mac,
Safari 1.2 and Mac MSIE 5.2.  I think it's because the code samples use <code>
nested inside <pre> which confuses default.css

Reproducible: Always
Steps to Reproduce:
1. Surf to this URL http://www.mozilla.org/projects/xslt/js-interface.html
2. Note the big scrollbar and the long single-line first example.
3. View > Source

Actual Results:  
All three of my Mac browsers render the code samples as one long line, yet in
source it is

<pre><code>var testTransform =
document.implementation.createDocument("", "test", null);
// just an example to get a transform into a script as a DOM
...
{</code>
</pre>


Expected Results:  
Multi-line code examples in a <pre>-formatted block should appear on multiple lines.

To fix:
A. If I remove the link to ../../css/default.css the sample code wraps as expected.
B. If I remove the <code> tag inside the <pre> tag the sample code wraps as
expected.

So you do B to fix the page, but there may be some issue with the site's
default.css.

Comment 1

14 years ago
	code {
		white-space: nowrap;
	}
in www.mozilla.org/css/default.css causes this
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 2

14 years ago
fix to default.css checked in
Product: mozilla.org → Websites
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.