"../manipulation/buildFragment",
], function( jQuery, document, rsingleTag, buildFragment, support ) {
jQuery.parseHTML = function( data, context, keepScripts ) {
if ( typeof data !== "string" ) {
if ( typeof context === "boolean" ) {
var base, parsed, scripts;
if ( support.createHTMLDocument ) {
context = document.implementation.createHTMLDocument( "" );
base = context.createElement( "base" );
base.href = document.location.href;
context.head.appendChild( base );
parsed = rsingleTag.exec( data );
scripts = !keepScripts && [];
return [ context.createElement( parsed[ 1 ] ) ];
parsed = buildFragment( [ data ], context, scripts );
if ( scripts && scripts.length ) {
jQuery( scripts ).remove();
return jQuery.merge( [], parsed.childNodes );