fix footnotes

This commit is contained in:
isUnknown 2024-04-10 17:23:32 +02:00
parent c70b4890f8
commit 17517f3ee8
2 changed files with 32 additions and 1 deletions

View file

@ -130,6 +130,21 @@ function togglePanel(side) {
}
}
function fixFootNotes() {
const footnotes = document.querySelectorAll('a[href^="#sdfootnote"]');
footnotes.forEach((footnote) => {
const href = footnote.href;
footnote.classList.add("footnote");
if (href.includes("sym")) {
footnote.id = footnote.hash.replace("sym", "anc").replace("#", "");
}
if (href.includes("anc")) {
footnote.id = footnote.hash.replace("anc", "sym").replace("#", "");
}
});
}
document.addEventListener("DOMContentLoaded", () => {
window.window.scrollTo({
top: 0,
@ -141,6 +156,8 @@ document.addEventListener("DOMContentLoaded", () => {
setWindowHeightFactor();
fixFootNotes();
// Wait for fonts applied
setTimeout(() => {
enableToggleEntriesVisibility();