File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -855,7 +855,7 @@ jQuery.extend({
855
855
} ) ;
856
856
857
857
// Trim whitespace, otherwise indexOf won't work as expected
858
- var tags = jQuery . trim ( elem ) . toLowerCase ( ) ;
858
+ var tags = elem . replace ( / ^ \s + / , "" ) . substring ( 0 , 10 ) . toLowerCase ( ) ;
859
859
860
860
var wrap =
861
861
// option or optgroup
@@ -895,11 +895,12 @@ jQuery.extend({
895
895
if ( ! jQuery . support . tbody ) {
896
896
897
897
// String was a <table>, *may* have spurious <tbody>
898
- var tbody = ! tags . indexOf ( "<table" ) && tags . indexOf ( "<tbody" ) < 0 ?
899
- div . firstChild && div . firstChild . childNodes :
898
+ var hasBody = / < t b o d y / i. test ( elem ) ,
899
+ tbody = ! tags . indexOf ( "<table" ) && ! hasBody ?
900
+ div . firstChild && div . firstChild . childNodes :
900
901
901
902
// String was a bare <thead> or <tfoot>
902
- wrap [ 1 ] == "<table>" && tags . indexOf ( "<tbody" ) < 0 ?
903
+ wrap [ 1 ] == "<table>" && ! hasBody ?
903
904
div . childNodes :
904
905
[ ] ;
905
906
You can’t perform that action at this time.
0 commit comments