Commit 334462b2 authored by John Resig's avatar John Resig

IE prunes whitespace from the start of innerHTML-injected strings. This fixes that.

parent d8e9f0c6
...@@ -1587,7 +1587,11 @@ jQuery.extend({ ...@@ -1587,7 +1587,11 @@ jQuery.extend({
for ( var n = tb.length-1; n >= 0 ; --n ) for ( var n = tb.length-1; n >= 0 ; --n )
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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment