blob: fee005d95b8c886705fd4ed8e9b8dca5a416bc9b [file] [log] [blame]
document.addEventListener('DOMContentLoaded', function () {
// If section divs is used, we need to put the anchor in the child header
const headers = document.querySelectorAll("div.hasAnchor.section[class*='level'] > :first-child")
headers.forEach(function (x) {
// Add to the header node
if (!x.classList.contains('hasAnchor')) x.classList.add('hasAnchor')
// Remove from the section or div created by Pandoc
x.parentElement.classList.remove('hasAnchor')
})
})