summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-10-31 10:09:26 +0800
committerEltrac <hi@guhub.cn>2025-10-31 10:09:26 +0800
commit68d31a8bc62e843fe1c1e77245552d80f9096ca2 (patch)
tree509f335d4e694722b678529502924c79c78822df /assets
parent3cf6b3dbf3caed7882fc9c3f46a2205f25469e63 (diff)
parent5d4ef40c12f5681ed52c3651f5546ac91366146e (diff)
Merge branch 'master' of https://github.com/BigCoke233/geek-death-project
Diffstat (limited to 'assets')
-rw-r--r--assets/js/inject-footnotes.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/assets/js/inject-footnotes.js b/assets/js/inject-footnotes.js
index ced518e9..faf44baf 100644
--- a/assets/js/inject-footnotes.js
+++ b/assets/js/inject-footnotes.js
@@ -12,8 +12,16 @@ document.addEventListener("DOMContentLoaded", () => {
// construct note element
const inline = document.createElement("div");
inline.className = "text-sm text-secondary flex gap-2 ml-4";
- inline.innerHTML = noteNumber + note.innerHTML;
+
+ const footnoteNumber = document.createElement('span')
+ footnoteNumber.textContent = noteNumber;
+ const footnoteContent = document.createElement('div');
+ footnoteContent.innerHTML = note.innerHTML;
+
+ inline.appendChild(footnoteNumber);
+ inline.appendChild(footnoteContent);
inline.id = noteId;
+
// insert adjacent to paragraph
ref.parentNode.insertAdjacentElement("afterend", inline);
}