summaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-10-30 18:45:42 +0800
committerEltrac <hi@guhub.cn>2025-10-30 18:45:42 +0800
commit3b01037abeb50abe8373375c39f36c406dc46341 (patch)
tree8055bd58cb95f069f82ef7b433fe9bff8bf55f6a /assets/js
parent44f0799510713db69dc2c550ca52e5675b32b556 (diff)
docs: update draft
Former-commit-id: 28f48522ec7313074d6c8f89c36570ad9511d3f6
Diffstat (limited to 'assets/js')
-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);
}