From: John Resig Date: Thu, 31 Aug 2006 04:19:59 +0000 (+0000) Subject: Fixed issue with comment text being included in .text() results. X-Git-Tag: 1.0~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=78a7cf63f6e984e4c87cdef52688283f81846f0b;p=jquery.git Fixed issue with comment text being included in .text() results. --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index c8605d985..fc3d5515b 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -378,8 +378,9 @@ jQuery.fn = jQuery.prototype = { for ( var j = 0; j < e.length; j++ ) { var r = e[j].childNodes; for ( var i = 0; i < r.length; i++ ) - t += r[i].nodeType != 1 ? - r[i].nodeValue : jQuery.fn.text([ r[i] ]); + if ( r[i].nodeType != 8 ) + t += r[i].nodeType != 1 ? + r[i].nodeValue : jQuery.fn.text([ r[i] ]); } return t; },