nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jquery / src / core / parseHTML.js
1 define( [
2         "../core",
3         "../var/document",
4         "./var/rsingleTag",
5         "../manipulation/buildFragment"
6 ], function( jQuery, document, rsingleTag, buildFragment ) {
7
8 // Argument "data" should be string of html
9 // context (optional): If specified, the fragment will be created in this context,
10 // defaults to document
11 // keepScripts (optional): If true, will include scripts passed in the html string
12 jQuery.parseHTML = function( data, context, keepScripts ) {
13         if ( !data || typeof data !== "string" ) {
14                 return null;
15         }
16         if ( typeof context === "boolean" ) {
17                 keepScripts = context;
18                 context = false;
19         }
20         context = context || document;
21
22         var parsed = rsingleTag.exec( data ),
23                 scripts = !keepScripts && [];
24
25         // Single tag
26         if ( parsed ) {
27                 return [ context.createElement( parsed[ 1 ] ) ];
28         }
29
30         parsed = buildFragment( [ data ], context, scripts );
31
32         if ( scripts && scripts.length ) {
33                 jQuery( scripts ).remove();
34         }
35
36         return jQuery.merge( [], parsed.childNodes );
37 };
38
39 return jQuery.parseHTML;
40
41 } );