celian-rib / vscode-webvalidation-extension

VSCode extension that let you check if an HTML or CSS file respect the W3C standards.
https://marketplace.visualstudio.com/items?itemName=CelianRiboulet.webvalidator
MIT License
24 stars 3 forks source link

[Feat Request] Validate partials #11

Closed hefler closed 1 year ago

hefler commented 3 years ago

It would be nice if this extension also validated HTML partials (without html, head and body tags).

All this tags could be "implied" if not present in an HTML document.

celian-rib commented 3 years ago

I @hefler , do you have a file as an example ?

hefler commented 3 years ago

Let's say this is an HTML file called partials.html.

<div>
    <header>
        <h1>HTML5 Partials</h1>
        <h2>Small bits of HTML</h2>
    </header>
    <main>
        <p>This is a perfect "validatable" piece of HTML code that fails get validated.</p>
        <p>Yet validating partials such as this can be useful. :)</p>
    </main>
</div>

Then in the extension preferences having something like:

Validate partials as:

  • [x] HTML5
  • [ ] XHTML
  • [ ] HTML4