Skip to content
Permalink
Browse files

Fix for jQuery.clean that caused Safari to crash with newline characters

  • Loading branch information
brandonaaron committed Oct 25, 2006
1 parent 215aab2 commit f1f3d6f300f6db94910b11f387c7f9b741627c02
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/jquery/jquery.js
@@ -1565,10 +1565,13 @@ jQuery.extend({
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + s + wrap[2];
while ( wrap[0]-- ) div = div.firstChild;
arg = div.childNodes;
}

if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections

// Have to loop through the childNodes here to
// prevent a Safari crash with text nodes and /n characters
for ( var j = 0; j < div.childNodes.length; j++ )
r.push( div.childNodes[j] );
}
else if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections
for ( var n = 0; n < arg.length; n++ )
r.push(arg[n]);
else

0 comments on commit f1f3d6f

Please sign in to comment.
You can’t perform that action at this time.