HTML5 writer footnote changes (aria-role, element type).

* To conform to validator's expectations, `doc-footnote` role is used
  with `aside` and `doc-endnotes` with `section`.
* `aside` is used only for notes at ends of sections or blocks;
  if all the notes come at the end of the document, `section` is
  used so we can have the `doc-endnotes` role.
This commit is contained in:
John MacFarlane
2023-12-04 09:22:58 -08:00
parent dbdb4d9c1f
commit 41da8ad9e0
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -544,14 +544,14 @@ footnoteSection opts refLocation startCounter notes = do
! customAttribute "epub:type" "footnotes" $ x
| html5
, refLocation == EndOfDocument
, slideVariant == RevealJsSlides -- need a section for a new slide:
-- Note: we need a section for a new slide in slide formats.
= H5.section ! A5.id "footnotes"
! A5.class_ className
! A5.role "doc-endnotes"
$ x
| html5 = H5.aside ! prefixedId opts "footnotes"
! A5.class_ className
! A5.role "doc-endnotes"
! A5.role "doc-footnote"
$ x
| slideVariant /= NoSlides = H.div ! A.class_ "footnotes slide" $ x
| otherwise = H.div ! A.class_ className $ x
+2 -2
View File
@@ -4,12 +4,12 @@ This.^[Has a footnote.]
^D
<p>This.<a href="#foofn1" class="footnote-ref" id="foofnref1"
role="doc-noteref"><sup>1</sup></a></p>
<aside id="foofootnotes" class="footnotes footnotes-end-of-document"
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="foofn1"><p>Has a footnote.<a href="#foofnref1"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</aside>
</section>
```
+2 -2
View File
@@ -8,7 +8,7 @@ Test.[^fn]
^D
<p>Test.<a href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a></p>
<aside id="footnotes" class="footnotes footnotes-end-of-document"
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
@@ -19,5 +19,5 @@ role="doc-endnotes">
</figure>
<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></li>
</ol>
</aside>
</section>
```
+2 -2
View File
@@ -740,7 +740,7 @@ role="doc-noteref"><sup>4</sup></a></p>
role="doc-noteref"><sup>5</sup></a></li>
</ol>
<p>This paragraph should not be part of the note, as it is not indented.</p>
<aside id="footnotes" class="footnotes footnotes-end-of-document"
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
@@ -763,6 +763,6 @@ role="doc-backlink">↩︎</a></p></li>
<li id="fn5"><p>In list.<a href="#fnref5" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
</ol>
</aside>
</section>
</body>
</html>