praveenvijayan / grunt-html-validation

W3C html validaton grunt plugin. Validate all files in a directory automatically.
MIT License
75 stars 39 forks source link

Consider using h1 elements as top-level headings only #55

Closed XhmikosR closed 9 years ago

XhmikosR commented 10 years ago

We are getting "Consider using h1 elements as top-level headings only (all h1 elements are treated as top-level headings by many screen readers and other tools).".

Even though I add this in relaxerror, I still get the warnings.

validation: {
  options: {
    charset: 'utf-8',
    doctype: 'HTML5',
    failHard: true,
    reset: true,
    relaxerror: [
      'Attribute ontouchstart not allowed on element body at this point.',
      'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
      'Consider using h1 elements as top-level headings only (all h1 elements are treated as top-level headings by many screen readers and other tools).'
    ]
  },
  files: {
    src: '_site/**/*.html'
  }
},

Is this because this isn't really an error but a help message? Is there any way to suppress this kind of errors?

XhmikosR commented 10 years ago

For reference https://travis-ci.org/twbs/ratchet/builds/25766130

cvrebert commented 10 years ago

@XhmikosR You need to escape the parentheses because relaxerror takes regexps.

XhmikosR commented 10 years ago

@cvrebert: I'm not sure I get it. \( will still result in the same stuff plus it's unnecessary escape. Am I missing something?

lefoy commented 9 years ago

+1, I also have this error.

lefoy commented 9 years ago

It works if I use this: '^Consider using the h1'

XhmikosR commented 9 years ago

This doesn't seem to happen anymore so I guess it was an upstream issue.