diff options
| -rw-r--r-- | assets/js/inject-footnotes.js | 7 |
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 |
