Skip to content

Commit

Permalink
Shorter code, using a regexp for replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Batiste Bieler committed Nov 12, 2009
1 parent d71b8b1 commit cae87d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/attributes.js
Expand Up @@ -59,8 +59,7 @@ jQuery.fn.extend({
// according to the HTML W3C documentation
// carriage return and tab should be replaced with a single space
// http://www.w3.org/TR/html401/types.html#type-cdata
className = className.replace("\n", " ");
className = className.replace("\t", " ");
className = className.replace(/[\n\t]/g, " ");
if ( className.indexOf( searchTerm ) > -1 ) {
return true;
}
Expand Down

0 comments on commit cae87d1

Please sign in to comment.