Skip to content

Commit

Permalink
Use the getText utility function provided by Sizzle.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Dec 7, 2009
1 parent 2092789 commit 3f7fc25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
15 changes: 1 addition & 14 deletions src/manipulation.js
Expand Up @@ -36,20 +36,7 @@ jQuery.fn.extend({
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
} }


var ret = ""; return jQuery.getText( this );

jQuery.each( this, function() {
// Get the text from text nodes and CDATA nodes
if ( this.nodeType === 3 || this.nodeType === 4 ) {
ret += this.nodeValue;

// Traverse everything else, except comment nodes
} else if ( this.nodeType !== 8 ) {
ret += jQuery.fn.text.call( this.childNodes );
}
});

return ret;
}, },


wrapAll: function( html ) { wrapAll: function( html ) {
Expand Down
1 change: 1 addition & 0 deletions src/sizzle-jquery.js
Expand Up @@ -2,5 +2,6 @@ jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors; jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters; jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort; jQuery.unique = Sizzle.uniqueSort;
jQuery.getText = getText;


return; return;

0 comments on commit 3f7fc25

Please sign in to comment.