Fixed this issue: $("<div>foo\nbar</div>");

This commit is contained in:
John Resig 2007-01-22 03:25:00 +00:00
parent 6c072457ed
commit 34c0bed54a

View file

@ -38,7 +38,7 @@ var jQuery = function(a,c) {
// Handle HTML strings // Handle HTML strings
if ( typeof a == "string" ) { if ( typeof a == "string" ) {
// HANDLE: $(html) -> $(array) // HANDLE: $(html) -> $(array)
var m = /^[^<]*(<.+>)[^>]*$/.exec(a); var m = /^[^<]*(<(.|\n)+>)[^>]*$/.exec(a);
if ( m ) if ( m )
a = jQuery.clean( [ m[1] ] ); a = jQuery.clean( [ m[1] ] );
@ -1219,6 +1219,7 @@ jQuery.extend({
noConflict: function() { noConflict: function() {
if ( jQuery._$ ) if ( jQuery._$ )
$ = jQuery._$; $ = jQuery._$;
return jQuery;
}, },
// This may seem like some crazy code, but trust me when I say that this // This may seem like some crazy code, but trust me when I say that this