Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5483 closed bug (fixed)

Another Result in .html() with \r\n at the beginning (1.4pre)

Reported by: Sebmaster Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

If you call .html('</body>\r\n</html>') on an div for example, you get a different value, than with .html('\r\n</body>\r\n</html>'). In jQuery 1.3.2, this isn't the case.

.html('\r\n&lt;/body&gt;\r\n&lt;/html&gt;') FF 3.5.5 + jQ 1.4pre => &lt;/body&gt;&lt;/html&gt; FF 3.5.5 + jQ 1.3.2 => </body></html> IE 8 + jQ 1.4pre => </body></html> IE 8 + jQ 1.3.2 => </body></html>

I included the test case.

Attachments (2)

test.htm (341 bytes) - added by Sebmaster 10 years ago.
Test Case
test-5483.html (452 bytes) - added by dmethvin 10 years ago.
Updated test case showing problem with leading spaces

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Sebmaster

Attachment: test.htm added

Test Case

comment:1 Changed 10 years ago by dmethvin

The string passed to .html() should have matched tags, be able to be placed inside the <div> element that's used to convert it to DOM elements, and be valid for the doctype of the document. I updated the test case to reflect that and the problem is still there. It only seems to happen with leading spaces.

Changed 10 years ago by dmethvin

Attachment: test-5483.html added

Updated test case showing problem with leading spaces

comment:2 Changed 10 years ago by dmethvin

Component: unfilledcore
need: ReviewPatch

comment:3 Changed 10 years ago by dmethvin

HTML output of the test case:

<div>&lt;div&gt;hello1&lt;/div&gt;</div>
<div>x&lt;div&gt;hello2&lt;/div&gt;</div>
<div> &amp;lt;div&amp;gt;hello2&amp;lt;/div&amp;gt;</div>

comment:4 Changed 10 years ago by john

Milestone: 1.4
Resolution: fixed
Status: newclosed
Version: 1.3.2
Note: See TracTickets for help on using tickets.