Bug Tracker

Opened 10 years ago

Closed 8 years ago

#4749 closed enhancement (invalid)

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 ! :)

Change History (4)

comment:1 Changed 10 years ago by dmethvin

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

comment:2 Changed 10 years ago by dmethvin

Component: unfilledcore

comment:3 Changed 9 years ago by Rick Waldron

Owner: set to luka8088
Priority: minorlow
Status: newpending

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

comment:4 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.