validator/grunt-html

Feature request: Ignore certain error messages

Closed this issue · 1 comments

The grunt task should have an option to ignore certain errors. Originally suggested via #15:

I am using grunt-html to validate a set of HTML files which are actually HTML fragments, so I need to ignore certain messages. I added an option called 'ignore', which accepts an array of messages to ignore.

Example usage:

grunt.initConfig({
    htmllint: {
        options: {
            ignore: [
                'Element "head" is missing a required instance of child element "title".',
                'Start tag seen without seeing a doctype first. Expected e.g. "<!DOCTYPE html>".'
            ]
        },
        all: ['content/**/*.html']
    }
});

The filtering should be implemented in lib/htmllint.js along with tests.

Part of v1.1.0. /cc @dsturley @ricick @saintmac