mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-13 12:57:24 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
```
|
||||
|
||||
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user