X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=cb898cc3ca109b16b60d48f63424cf1cff610d53;hb=8effe3a7dee91c833cc1774646da9d743600c64c;hp=9406aa83949e2b490fed5fcd9c48731998f33da3;hpb=ec7fdf37235583a807b3f08e146edaadc81ca974;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 9406aa8..cb898cc 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -1,39 +1,69 @@ -jQuery.fn.extend({ - text: function( text ) { - if ( typeof text !== "object" && text !== undefined ) - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, + rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, + rtagName = /<([\w:]+)/, + rtbody = /"; + }, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; - var ret = ""; +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; - jQuery.each( text || this, function(){ - jQuery.each( this.childNodes, function(){ - if ( this.nodeType !== 8 ) { - ret += this.nodeType !== 1 ? - this.nodeValue : - jQuery.fn.text( [ this ] ); - } +// IE can't serialize and