Skip to main content

Bug Tracker

Side navigation

#12180 closed bug (invalid)

Opened August 02, 2012 04:52AM UTC

Closed August 14, 2012 12:34PM UTC

loose markup parsing incorrect

Reported by: fredyang@semanticsworks.com Owned by:
Priority: low Milestone: None
Component: core Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

it is documented in unit test using qunit

http://jsfiddle.net/jgSrn/

Attachments (0)
Change History (2)

Changed August 02, 2012 04:56AM UTC by fredyang@semanticsworks.com comment:1

the url should be http://jsfiddle.net/jgSrn/1/

Changed August 14, 2012 12:34PM UTC by sindresorhus comment:2

component: unfiledcore
priority: undecidedlow
resolution: → invalid
status: newclosed

Works as intended. See docs:

When passing HTML to jQuery(), please also note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally otherwise ignored or removed. E.g:
var el = $('1<br/>2<br/>3'); // returns [<br>, "2", <br>] el = $('1<br/>2<br/>3 >'); // returns [<br>, "2", <br>, "3 >"]