Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

compress by slightly deviating from convention

  • Loading branch information...
commit f6ec2f3d7ba168a36495f8d1a76d16f681faa038 1 parent 698d28b
@gibson042 authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/core.js
View
9 src/core.js
@@ -463,7 +463,6 @@ jQuery.extend({
// 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
parseHTML: function( data, context, keepScripts ) {
- var parsed, scripts;
if ( !data || typeof data !== "string" ) {
return null;
}
@@ -473,18 +472,20 @@ jQuery.extend({
}
context = context || document;
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
// Single tag
- if ( (parsed = rsingleTag.exec( data )) ) {
+ if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
- scripts = !keepScripts && [];
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [],
- (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
+ ( parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment ).childNodes );
},
parseJSON: function( data ) {
Please sign in to comment.
Something went wrong with that request. Please try again.