Thanks for opening the ticket. I could use that but I don't think it
would give me what I'm looking for.. my <pre> is full of HTML junk
(needed for syntax highlighting) from Textmate. Have a look at
http://pastie.org/230104 for an example.

On 8 Jul, 15:55, Dave Methvin <[EMAIL PROTECTED]> wrote:
> > The problem for me is that using text() in IE 6/7 doesn't preserve
> > whitespace...
>
> As a workaround, you can use an expression like this:
>
> var pre = $("<pre>").get(0);
>
> alert(pre.innerText || pre.textContent);
>
> All the browsers seem to support one property or the other--or both.
> Their text output isn't exactly the same in all cases, but at least
> there's some sort of whitespace.
>
> The additional case that jQuery's .text() has to handle is XML, where
> neither of these properties are available. I guess that's why it
> wasn't used.
>
> I opened a ticket:http://dev.jquery.com/ticket/3144

Reply via email to