IE prunes whitespace from the start of innerHTML-injected strings. This fixes that.
This commit is contained in:
parent
d8e9f0c616
commit
334462b23c
4
src/jquery/jquery.js
vendored
4
src/jquery/jquery.js
vendored
|
@ -1588,6 +1588,10 @@ jQuery.extend({
|
||||||
if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
|
if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
|
||||||
tb[n].parentNode.removeChild(tb[n]);
|
tb[n].parentNode.removeChild(tb[n]);
|
||||||
|
|
||||||
|
// IE completely kills leading whitespace when innerHTML is used
|
||||||
|
if ( /^\s/.test(arg) )
|
||||||
|
div.insertBefore( doc.createTextNode( arg.match(/^\s*/)[0] ), div.firstChild );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arg = jQuery.makeArray( div.childNodes );
|
arg = jQuery.makeArray( div.childNodes );
|
||||||
|
|
Loading…
Reference in a new issue