Sha256: d098e8f8438e822a4d8977a1ab28bfadb2812990fe3f4c9241ca69a47e6ce588
Contents?: true
Size: 1.25 KB
Versions: 3
Compression:
Stored size: 1.25 KB
Contents
define( [ "../core", "../var/document", "./var/rsingleTag", "../manipulation/buildFragment", // This is the only module that needs core/support "./support" ], function( jQuery, document, rsingleTag, buildFragment, support ) { // Argument "data" should be string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } // Stop scripts or inline event handlers from being executed immediately // by using document.implementation context = context || ( support.createHTMLDocument ? document.implementation.createHTMLDocument( "" ) : document ); var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; return jQuery.parseHTML; } );
Version data entries
3 entries across 3 versions & 1 rubygems