nuxt-modules/html-validator

Generating files doesn't detect error

hbanham opened this issue · 2 comments

Version

module: 0.1.2
nuxt: 2.14.7

Nuxt configuration

target:

  • static

Reproduction

Link:
[x] GitHub repository
Link to repo
I've added an incorrect "httpEquiv" attribute inside head() in the default layout file.

What is expected?

When running yarn generate, HTML Validator should show
8:25 error Attribute "httpEquiv" should be lowercase attr-case error in console

What is actually happening?

The error is not detected: No HTML validation errors found for \index.html
Note: The error shows in development, just not in generate.

Steps to reproduce

  1. yarn
  2. yarn dev (error is shown in console regarding incorrect httpEquiv - should be "http-equiv".
  3. yarn generate (the error is not shown).

Additional information

Checklist

  • I have tested with the latest Nuxt version and the issue still occurs
  • I have tested with the latest module version and the issue still occurs
  • I have searched the issue tracker and this issue hasn't been reported yet

@hbanham The reason appears to be that the generated HTML is the following:

<meta data-n-head="ssr" httpequiv="x-ua-compatible" content="ie=edge">

This is still an issue but it's not a case issue and so doesn't trigger the html-validate rule.

Thank you for taking a look!

Oh and so it doesn't pick up the error any longer. Shame html-validate doesn't pick up an invalid attribute, I had an expectation that it would.
Looks as though an issue already exists for this on the the html-validate repo:
https://gitlab.com/html-validate/html-validate/-/issues/68

Closing as I realise this is not a fix specific to this module and I'm sure it will be fixed in a future release of html-validate. Looks as though they released 4.0.0 very recently but I don't think it included this feature.
https://gitlab.com/html-validate/html-validate/-/releases