Skip to main content

Bug Tracker

Side navigation

#4749 closed enhancement (invalid)

Opened June 11, 2009 08:38PM UTC

Closed December 02, 2010 08:07AM UTC

BR to new line when working with pre elements

Reported by: luka8088 Owned by: luka8088
Priority: low Milestone: 1.4
Component: core Version: 1.3.2
Keywords: pre nl br text Cc:
Blocked by: Blocking:
Description

Hi, I need to manipulate with text() taken from pre element...

When content of that element is dynamically changed (new line is added), some browsers (firefox) adds br element, and then, when I fetch text() with query that newline is ignored... so, I have suggestion to change text() function from:

jQuery.each( text || this, function(){

jQuery.each( this.childNodes, function(){

if ( this.nodeType != 8 )

ret += this.nodeType != 1 ?

this.nodeValue :

jQuery.fn.text( [ this ] );

});

});

to:

jQuery.each( text || this, function(){

jQuery.each( this.childNodes, function(){

if ( this == '[object HTMLBRElement]' )

ret += '\\n';

else if ( this.nodeType != 8 )

ret += this.nodeType != 1 ?

this.nodeValue :

jQuery.fn.text( [ this ] );

});

});

on line 207 in jquery-1.3.2.js

Thanks ! :)

Attachments (0)
Change History (4)

Changed August 07, 2009 04:44PM UTC by dmethvin comment:1

Please attach a test case that demonstrates when this problem occurs.

Changed August 07, 2009 04:45PM UTC by dmethvin comment:2

component: unfilledcore

Changed November 01, 2010 08:58PM UTC by rwaldron comment:3

owner: → luka8088
priority: minorlow
status: newpending

This has been ignored by the reporter since the initial request for a test case was filed.

Changed December 02, 2010 08:07AM UTC by trac-o-bot comment:4

resolution: → invalid
status: pendingclosed

Automatically closed due to 14 days of inactivity.