Use footer element for footnotes

This commit is contained in:
Helen Chong 2024-06-13 19:19:40 +08:00
parent 16105d8bcf
commit e54a91d5c7
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,7 @@ module.exports = function (eleventyConfig) {
// Configure markdown-it-footnote
markdownLibrary.renderer.rules.footnote_block_open = () => (
'<section class="footnotes">\n' +
'<footer class="footnotes">\n' +
`<div class="heading-wrapper h2">
<h2 id="footnotes" class="footnotes__title">Footnotes</h2>
<a class="heading-anchor" href="#footnotes" aria-labelledby="footnotes"><span hidden="">#</span></a>
@ -96,6 +96,7 @@ module.exports = function (eleventyConfig) {
const renderRules = {
footnote_caption: ['[', '[<span class="visually-hidden">Footnote #</span>'],
footnote_block_close: ['section', 'footer'],
};
Object.keys(renderRules).map(rule => {
let defaultRender = markdownLibrary.renderer.rules[rule];