diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-08-16 09:59:58 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-09-07 20:03:50 +0300 |
commit | 10fdad742a2a6aa9f0e00b3e04fc5264797c53c7 (patch) | |
tree | 6b6d7b1375ff88f4bebbfa0703f7b595eb485df9 /src/core/parseHTML.js | |
parent | 7aa46e0df8a673e6b00550bbbbed21eed50108b7 (diff) | |
download | jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.tar.gz jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.zip |
Build: Update jscs and lint files
Fixes gh-2056
Diffstat (limited to 'src/core/parseHTML.js')
-rw-r--r-- | src/core/parseHTML.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/parseHTML.js b/src/core/parseHTML.js index e7d7c63c8..30405363c 100644 --- a/src/core/parseHTML.js +++ b/src/core/parseHTML.js @@ -1,4 +1,4 @@ -define([ +define( [ "../core", "../var/document", "./var/rsingleTag", @@ -8,7 +8,7 @@ define([ "./support" ], function( jQuery, document, rsingleTag, buildFragment, support ) { -// data: string of html +// 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 @@ -20,8 +20,9 @@ jQuery.parseHTML = function( data, context, keepScripts ) { keepScripts = context; context = false; } - // document.implementation stops scripts or inline event handlers from - // being executed immediately + + // Stop scripts or inline event handlers from being executed immediately + // by using document.implementation context = context || ( support.createHTMLDocument ? document.implementation.createHTMLDocument( "" ) : document ); @@ -31,7 +32,7 @@ jQuery.parseHTML = function( data, context, keepScripts ) { // Single tag if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; + return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); @@ -45,4 +46,4 @@ jQuery.parseHTML = function( data, context, keepScripts ) { return jQuery.parseHTML; -}); +} ); |