Skip to content

Commit

Permalink
[Fixes twbs#249] Use parse5 for standard-compliant parsing
Browse files Browse the repository at this point in the history
[Fixes twbs#249] Use parse5 for standard-compliant parsing
  • Loading branch information
Kevin Kirsche committed Feb 28, 2015
1 parent f454029 commit c421645
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
37 changes: 32 additions & 5 deletions dist/browser/bootlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -10379,6 +10379,31 @@ if (typeof define === 'function' && define.amd)
);

},{}],4:[function(require,module,exports){
/**
* This file automatically generated from `pre-publish.js`.
* Do not manually edit.
*/

module.exports = {
"area": true,
"base": true,
"br": true,
"col": true,
"embed": true,
"hr": true,
"img": true,
"input": true,
"keygen": true,
"link": true,
"menuitem": true,
"meta": true,
"param": true,
"source": true,
"track": true,
"wbr": true
};

},{}],5:[function(require,module,exports){
/*!
* Bootlint - an HTML linter for Bootstrap projects
* https://github.com/twbs/bootlint
Expand All @@ -10388,9 +10413,10 @@ if (typeof define === 'function' && define.amd)

/*eslint-env node */

var cheerio = require('cheerio');
var cheerio = require('whacko');
var parseUrl = require('url').parse;
var semver = require('semver');
var voidElements = require('void-elements');
var _location = require('./location');
var LocationIndex = _location.LocationIndex;

Expand Down Expand Up @@ -11209,15 +11235,16 @@ var LocationIndex = _location.LocationIndex;
});
addLinter("W009", function lintEmptySpacerCols($, reporter) {
var selector = COL_CLASSES.map(function (colClass) {
return colClass + ':not(col):not(:last-child)';
return colClass + ':not(:last-child)';
}).join(',');
var columns = $(selector);
columns.each(function (_index, col) {
var column = $(col);
var isVoidElement = voidElements[col.tagName.toLowerCase()];
// can't just use :empty because :empty excludes nodes with all-whitespace text content
var hasText = !!column.text().trim().length;
var hasChildren = !!column.children(':first-child').length;
if (hasChildren || hasText) {
if (hasChildren || hasText || isVoidElement) {
return;
}

Expand Down Expand Up @@ -11458,7 +11485,7 @@ var LocationIndex = _location.LocationIndex;
}
})(typeof exports === 'object' && exports || this);

},{"./location":1,"cheerio":2,"semver":3,"url":5}],5:[function(require,module,exports){
},{"./location":1,"semver":3,"url":6,"void-elements":4,"whacko":2}],6:[function(require,module,exports){
/*eslint-env node, browser */
/* jshint browser: true */
/**
Expand Down Expand Up @@ -11498,4 +11525,4 @@ var LocationIndex = _location.LocationIndex;
exports.parse = parse;
})();

},{}]},{},[4]);
},{}]},{},[5]);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"bluebird": "^2.9.12",
"body-parser": "^1.12.0",
"chalk": "^1.0.0",
"cheerio": "^0.18.0",
"whacko": "^0.17.4",
"commander": "^2.6.0",
"debug": "^2.1.1",
"express": "^4.11.2",
Expand All @@ -73,7 +73,7 @@
},
"browser": {
"binary-search": false,
"cheerio": "jquery",
"whacko": "jquery",
"url": "./src/url.js",
"./cli": false,
"./location": false
Expand Down
2 changes: 1 addition & 1 deletion src/bootlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*eslint-env node */

var cheerio = require('cheerio');
var cheerio = require('whacko');
var parseUrl = require('url').parse;
var semver = require('semver');
var voidElements = require('void-elements');
Expand Down
2 changes: 1 addition & 1 deletion test/bootlint_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports.bootlint = {
[],
'should not complain when the normal simple HTML5 doctype is used.');
test.deepEqual(lintHtml(utf8Fixture('doctype/html5-legacy.html')),
[],
['Document declares a non-HTML5 DOCTYPE'],
'should not complain when the legacy-compatibility HTML5 doctype is used.');
test.done();
},
Expand Down

0 comments on commit c421645

Please sign in to comment.