W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2007

[whatwg] Pre element question

From: Shadow2531 <shadow2531@gmail.com>
Date: Sat, 20 Jan 2007 19:36:21 -0500
Message-ID: <6b9c91b20701201636x4aa085cavdda1ab138589cdbb@mail.gmail.com>
On 1/20/07, Anne van Kesteren <annevk at opera.com> wrote:
> In Firefox 2, Opera 9 and Internet Explorer 7 the trailing newline is
> ignored as well.

Here's what I get.

<pre>
Line1
Line2
Line3
</pre>

(representing the newlines in the dom in escaped form)

[Page in Mac newline format]
Firefox: Line1%0ALine2%0ALine3%0A
Opera: Line1%0DLine2%0DLine3%0D
IE7: Line1%0DLine2%0DLine3%0D

[Page in *nix newline format]
Firefox: Line1%0ALine2%0ALine3%0A
Opera: Line1%0ALine2%0ALine3%0A
IE7: Line1%0DLine2%0DLine3%0D

[Page in windows newline format]
Firefox: Line1%0ALine2%0ALine3%0A
Opera: Line1%0D%0ALine2%0D%0ALine3%0D%0A
IE7: Line1%0DLine2%0DLine3%0D

So, IE7, Firefox and Opera trim the first newline after the start tag,
but don't trim the newline before the end tag.

And, Firefox is the only one that consistently gets the newlines in
the DOM right.

I just stick to:

<pre>Line1
Line2
Line3</pre>

and

<textarea>Line1
Line2
Line3</textarea>

so I get exactly what I want as far as the number of newlines are concerned.

-- 
burnout426
Received on Saturday, 20 January 2007 16:36:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:31 UTC