philipwalton / html-inspector

HTML Inspector is a code quality tool to help you and your team write better markup. It's written in JavaScript and runs in the browser, so testing your HTML has never been easier.
2.32k stars 145 forks source link

The <main> element can now appear more than once per page. #47

Open philipwalton opened 10 years ago

philipwalton commented 10 years ago

http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-main-element

impressivewebs commented 9 years ago

Great tool, Philip!

FYI, this is only true if you accept the WHATWG's version of the spec The W3C's still says that main should only be included once:

Authors must not include more than one main element in a document.

And:

Authors must not include the main element as a descendant of an article, aside, footer, header or nav element.

source

jonkessler commented 9 years ago

Well, what does html-inspector aim for? W3C validation success or markup correctness? If the WHATWG spec says it's OK, it's OK in my book.

philipwalton commented 9 years ago

I don't see it as being about validation success vs. markup correctness. I see it as about being consistent. HTML Inspector needs to either pick the W3C version or the WHATWG version of the spec and stick to it.

From looking at my current source, it seems like I picked the W3C version (probably by accident) without giving much thought to the choice between the two. Moving forward I should pick one and stick to it. WRT the <main> element, I don't think it makes sense to change this rule without changing the whole validation module.

Any thoughts? Recommendations?