epubcheck: `role="doc-pagebreak"` rejected on `a` element with no `href` attribute

A pagina EPUB-Check user is reporting the following issue with 4.2.0-rc:

HTML:

<a role="doc-pagebreak" id="page6" title="6" epub:type="pagebreak" class="pageref">6</a>

EPUBCheck report:

ERROR(RSC-005): ch0001.xhtml(11,88): Error while parsing file: value of attribute "role" is invalid; must be equal to "button", "checkbox", "doc-backlink", "doc-biblioref", "doc-glossref", "doc-noteref", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "switch", "tab" or "treeitem"

According to https://idpf.github.io/epub-guides/epub-aria-authoring/ should be tagged with <hr> but:

  • In addition to the specific elements listed in the table, the following elements accept any role value.

a (without an href attribute) […]

What’s wrong here?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

My PR validator/validator#774 has been merged, so the Nu HTML Checker is now aligned with the spec and will no longer reject the doc-pagebreak role on a elements with no href. Again, doing it is considered bad practice, but it’s not the role of conformance checkers to override the specs or report bad-but-conforming practices; this is better left out to best practice guidelines (like the KB).

I’ll create a PR to port the schema fix to EPUBCheck.

Now you make me feel bad about submitting that PR

All I meant is we probably shouldn’t rush to support this in epubcheck. If it doesn’t make the coming release, so be it. Better to be late to the party than get it wrong.

  • data on whether it’s used already in production

Given that we’ve always promoted pagebreaks through epub:type, I’d suspect very little. There’s also no reason to rush people to roles at this point, but that’s maybe something we should reconsider in Ace. We probably should tone down the messaging that every epub:type needs a role, and reconsider the elements we should even be considering equivalency on.