w3c / epubcheck

The conformance checker for EPUB publications
https://www.w3.org/publishing/epubcheck/
BSD 3-Clause "New" or "Revised" License
1.66k stars 403 forks source link

Check data-* name restrictions #1107

Closed mattgarrish closed 1 year ago

mattgarrish commented 4 years ago

I noticed that we check that data-* attributes are allowed in both XHTML and SVG content documents but we don't appear to be enforcing the naming restrictions in the HTML specification -- specifically that the name can't begin with "xml" or contain upper-ascii characters.

https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes

rdeltour commented 1 year ago

This should be ideally delegated to validator.nu, but I added a new check for it until we fully integrate the HTML checker.

I don't think validator.nu fully implements the rules btw (it does not complain if the attribute contains upper alphas). But in any case, I don't expect this check to report much new errors with existing content… we'll see!