]> source.dussan.org Git - jquery.git/commitdiff
Fixed issue with comment text being included in .text() results.
authorJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 04:19:59 +0000 (04:19 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 04:19:59 +0000 (04:19 +0000)
src/jquery/jquery.js

index c8605d9854e3c87ff79212dc1a6fce983ec2a34e..fc3d5515b4ba97a8dfef2c61e0417358cb38773f 100644 (file)
@@ -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;
        },