1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Merge pull request #68 from twbs/v4-validation

Switch HTML validators
This commit is contained in:
Chris Rebert 2015-02-04 14:12:41 -08:00
commit 7294506ebb
3 changed files with 462 additions and 686 deletions

View file

@ -272,24 +272,18 @@ module.exports = function (grunt) {
} }
}, },
validation: { htmllint: {
options: { options: {
charset: 'utf-8', ignore: [
doctype: 'HTML5', 'Element “img” is missing required attribute “src”.',
failHard: true, 'Bad value “X-UA-Compatible” for attribute “http-equiv” on element “meta”.',
reset: true, 'Attribute “autocomplete” not allowed on element “input” at this point.',
relaxerror: [ 'Attribute “autocomplete” not allowed on element “button” at this point.',
'Element img is missing required attribute src.', 'Element “div” not allowed as child of element “progress” in this context. (Suppressing further errors from this subtree.)',
'Attribute autocomplete not allowed on element input at this point.', 'Consider using the “h1” element as a top-level heading only (all “h1” elements are treated as top-level headings by many screen readers and other tools).'
'Attribute autocomplete not allowed on element button at this point.',
'Element div not allowed as child of element progress in this context.',
'Element thead not allowed as child of element table in this context.',
'Bad value tablist for attribute role on element nav.'
] ]
}, },
files: { src: '_gh_pages/**/*.html'
src: '_gh_pages/**/*.html'
}
}, },
watch: { watch: {
@ -358,7 +352,7 @@ module.exports = function (grunt) {
require('time-grunt')(grunt); require('time-grunt')(grunt);
// Docs HTML validation task // Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll:docs', 'validation']); grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']);
var runSubset = function (subset) { var runSubset = function (subset) {
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset; return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;

View file

@ -51,7 +51,7 @@
"grunt-contrib-watch": "~0.6.1", "grunt-contrib-watch": "~0.6.1",
"grunt-csscomb": "~3.0.0", "grunt-csscomb": "~3.0.0",
"grunt-exec": "~0.4.6", "grunt-exec": "~0.4.6",
"grunt-html-validation": "~0.1.18", "grunt-html": "^2.0.0",
"grunt-jekyll": "~0.4.2", "grunt-jekyll": "~0.4.2",
"grunt-jscs": "~1.2.0", "grunt-jscs": "~1.2.0",
"grunt-postcss": "^0.3.0", "grunt-postcss": "^0.3.0",

File diff suppressed because it is too large Load diff