1 | define([
|
2 | "../core",
|
3 | "./var/rsingleTag",
|
4 | "../manipulation"
|
5 | ], function( jQuery, rsingleTag ) {
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | jQuery.parseHTML = function( data, context, keepScripts ) {
|
11 | if ( !data || typeof data !== "string" ) {
|
12 | return null;
|
13 | }
|
14 | if ( typeof context === "boolean" ) {
|
15 | keepScripts = context;
|
16 | context = false;
|
17 | }
|
18 | context = context || document;
|
19 |
|
20 | var parsed = rsingleTag.exec( data ),
|
21 | scripts = !keepScripts && [];
|
22 |
|
23 |
|
24 | if ( parsed ) {
|
25 | return [ context.createElement( parsed[1] ) ];
|
26 | }
|
27 |
|
28 | parsed = jQuery.buildFragment( [ data ], context, scripts );
|
29 |
|
30 | if ( scripts && scripts.length ) {
|
31 | jQuery( scripts ).remove();
|
32 | }
|
33 |
|
34 | return jQuery.merge( [], parsed.childNodes );
|
35 | };
|
36 |
|
37 | return jQuery.parseHTML;
|
38 |
|
39 | });
|