Opened 14 years ago
Closed 12 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:
this, function(){ |
jQuery.each( this.childNodes, function(){
if ( this.nodeType != 8 )
ret += this.nodeType != 1 ?
this.nodeValue : jQuery.fn.text( [ this ] );
});
});
to:
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 14 years ago by
comment:2 Changed 14 years ago by
Component: | unfilled → core |
---|
comment:3 Changed 12 years ago by
Owner: | set to luka8088 |
---|---|
Priority: | minor → low |
Status: | new → pending |
This has been ignored by the reporter since the initial request for a test case was filed.
comment:4 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Automatically closed due to 14 days of inactivity.
Please attach a test case that demonstrates when this problem occurs.