[whatwg] Pre element question

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