grunt-w3c-markup-validation

Grunt task for W3C validation of markup

grunt-w3c-markup-validation

Grunt task for W3C validation of markup

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-w3c-markup-validation --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-w3c-markup-validation');

This task can be used to validate markup in local files or hosted in a site. Here is an example of it's use within a grunt file:

      grunt.initConfig({
        w3c_markup_validation : {
                failOnError : true,
                pages : ['./test-pages/fails.html', 'http://www.google.com'],
                ignore : ['no document type delaration']
            }
            });
            
            task('default', ['w3c_markup_validation']);
namedescription
pagesthe pages to validate
failOnErrorshould grunt stop if an error is encountered? (default is false)
ignoreignore any errors containing the specified text