Skip to content

Fix footnotes semantic organization for accessibility #2890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

wbg-zola
Copy link

@wbg-zola wbg-zola commented May 16, 2025

Footnotes are currently excluded in certain accessibility tools such as Firefox Reader View. This is because footnotes are nested underneath an HTML5 footer element, which permits the accessibility tool to discard the contents as irrelevant to the current section text under consideration.

Semantically, the footer element represents metainformation for its nearest ancestor sectioning content (e.g. publication timestamps, related links, authorship copyright, etc.). It's incorrect to place footnotes underneath the footer element because, while footnotes may be thematically distinct from the main content, they are considered semantically part of that content. Footnotes are merely a different section of content: their role is that of content supplementation, not metainformation.

In order to properly indicate the semantic relationship between the main content and its footnotes, the footnotes should be nested underneath a section element which adequately communicates this relationship. This isn't just speculation, but is in fact the exact way the WHATWG HTML5 specification document recommends implementing the footnotes with reciprocal backlinks idiom.

<p> Announcer: Number 16: The <i>hand</i>.
<p> Interviewer: Good evening. I have with me in the studio tonight
Mr Norman St John Polevaulter, who for the past few years has been
contradicting people. Mr Polevaulter, why <em>do</em> you
contradict people?
<p> Norman: I don't. <sup><a href="#fn1" id="r1">[1]</a></sup>
<p> Interviewer: You told me you did!
...
<section>
 <p id="fn1"><a href="#r1">[1]</a> This is, naturally, a lie,
 but paradoxically if it were true he could not say so without
 contradicting the interviewer and thus making it false.</p>
</section>

To that end, this patch changes the footnotes footer element to a section element. The class="footnotes" attribute remains the same so that user stylesheets may not be affected by this bug fix:

    <section class="footnotes">
    <ol class="footnotes-list">
    ...
    </ol>
    </section>

Test snapshots are also updated to reflect the adjustment.

Fixes: c4a84a8 ("Improve accessibility by nesting bottom footnotes inside footer element (#2688)")
Link: #2688

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

Footnotes are currently excluded in certain accessibility tools such as
Firefox Reader View. This is because footnotes are nested underneath an
HTML5 `footer` element, which permits the accessibility tool to discard
the contents as irrelevant to the current section text under
consideration.

Semantically, the `footer`[^1] element represents metainformation for
its nearest ancestor sectioning content (e.g. publication timestamps,
related links, authorship copyright, etc.). It's incorrect to place
footnotes underneath the `footer` element because, while footnotes may
be _thematically_ distinct from the main content, they are considered
**semantically** part of that content. Footnotes are merely a different
_section_ of content: their role is that of content supplementation, not
metainformation.

In order to properly indicate the semantic relationship between the
main content and its footnotes, the footnotes should be nested
underneath a `section`[^2] element which adequately communicates this
relationship. This isn't just speculation, but is in fact the exact way
the WHATWG HTML5 specification document recommends implementing the
footnotes with reciprocal backlinks idiom.[^3]

To that end, this patch changes the footnotes `footer` element to a
`section` element. The `class="footnotes"` attribute remains the same so
that user stylesheets may not be affected by this bug fix:

    <section class="footnotes">
    <ol class="footnotes-list">
    ...
    </ol>
    </section>

Test snapshots are also updated to reflect the adjustment.

[^1]: https://html.spec.whatwg.org/multipage/sections.html#the-footer-element
[^2]: https://html.spec.whatwg.org/multipage/sections.html#the-section-element
[^3]: https://html.spec.whatwg.org/multipage/semantics-other.html#footnotes

Fixes: c4a84a8 ("Improve accessibility by nesting bottom footnotes inside footer element (getzola#2688)")
Link: getzola#2688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant