summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-06 11:49:21 +0800
committerEltrac <hi@guhub.cn>2025-11-06 11:49:21 +0800
commit3b57124622e570ebb6a8535cde2bc8533c57c5e1 (patch)
tree00f107e51f9e243e826efe4d5e060c2538c74c13 /assets
parentb2aabfafa961a702556f14a958307ccd58ab938f (diff)
fix: footnote in table ruins layout
Former-commit-id: f483f7178d43910621ef303f62c5e89a991f3a61
Diffstat (limited to 'assets')
-rw-r--r--assets/js/inject-footnotes.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/assets/js/inject-footnotes.js b/assets/js/inject-footnotes.js
index faf44baf..20086ea6 100644
--- a/assets/js/inject-footnotes.js
+++ b/assets/js/inject-footnotes.js
@@ -23,7 +23,12 @@ document.addEventListener("DOMContentLoaded", () => {
inline.id = noteId;
// insert adjacent to paragraph
- ref.parentNode.insertAdjacentElement("afterend", inline);
+ // if it's inside a table, then insert outside the table
+ if (ref.closest('table')) {
+ ref.closest('table').insertAdjacentElement("afterend", inline);
+ } else {
+ ref.parentNode.insertAdjacentElement("afterend", inline);
+ }
}
}
// remove original footnotes