Content-Length: 217524 | pFad | http://github.com/begriffs/css-ratiocinator/commit/15b862b061d50e4254c6e656c9b193c1fcb54017

57 Ignore stupid ids and classes · begriffs/css-ratiocinator@15b862b · GitHub
Skip to content

Commit

Permalink
Ignore stupid ids and classes
Browse files Browse the repository at this point in the history
  • Loading branch information
begriffs committed Oct 12, 2013
1 parent f2e7877 commit 15b862b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ var CSS = (function () {
if (tag !== 'html') { // disregard classes on root element
if (node.attr('class')) {
_.each(node.attr('class').split(/\s+/), function (klass) {
if (klass) {
// Add classes but not crazy autogenerated ones that have long numbers
if (klass && !klass.match(/\d\d\d/)) {
soFar['.' + klass] = true;
soFar[node.prop('tagName').toLowerCase() + '.' + klass] = true;
}
});
}
if (node.attr('id')) {
// Add ids but not crazy autogenerated ones that have long numbers
if (node.attr('id') && !node.attr('id').match(/\d\d\d/)) {
soFar['#' + node.attr('id')] = true;
}
}
Expand Down

0 comments on commit 15b862b

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/begriffs/css-ratiocinator/commit/15b862b061d50e4254c6e656c9b193c1fcb54017

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy