daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
74 stars 22 forks source link

Possible wrong error with headings inside hgroup element? #391

Open Changilainen opened 11 months ago

Changilainen commented 11 months ago

I have EPUB with hgroup elements. Here's one example of the hgroup element I have used in the EPUB:

<body>
  <div>
    <hgroup id="_idContainer005">
      <h1 id="_idParaDest-6" class="Otsikko1">1</h1>
      <p class="EiTOCOtsikko1-Alaots">Prologi</p>
    </hgroup>
    <h2 class="EiTOCOtsikko2">Kaarlo</h2>
    <p>...</p>
  </div>
</body>

The latest epubcheck 5.1.0 doesn't give any warnings or errors. If I validate the xhtml files with html validator, I don't receive any errors or warnings. But ACE report gives me these following errors you can see on the right side of the picture: outlines-error

I'm not sure what the error "Error: no H1-H6 inside HGROUP" means in this case because there is one h1 element inside hgroup element.

Is there something wrong in my EPUB or is this false error from ACE? I'm using ACE 1.3.2 version on Windows 11.

polypunkt commented 2 months ago

I have the same problem, could you please explain the underlying check? Is it possible that the message is misleading, and the error is thrown if no

element is contained within

?

danielweck commented 2 months ago

Ah, I think the solution is: https://github.com/daisy/ace/issues/269

danielweck commented 2 months ago

Also see https://github.com/daisy/ace/issues/349#issuecomment-818980949

danielweck commented 2 months ago

could you please explain the underlying check?

The error message comes from a separate software package called h5o, which a future release of Ace will remove completely as the "HTML5 Outline Algorithm" is deemed unnecessary (doesn't map with actual real world usage of HTML heading / hierarchical sectioning, and interpretations from assistive technologies): https://github.com/h5o/h5o-js/blob/821d9a379e8ad0f87a638eadc376ab489736f394/src/asHTML.js#L11

polypunkt commented 2 months ago

Thanks a lot.