|
1 | 1 | import { addTooltip } from "~/util/tippy"; |
2 | 2 |
|
3 | | -const footnotes = document.querySelector("section.footnotes"); |
| 3 | +const footnotes = document.querySelectorAll("section.footnotes"); |
4 | 4 |
|
5 | 5 | if (footnotes) { |
6 | | - const notes = footnotes.querySelectorAll("li"); |
| 6 | + for (const section of footnotes) { |
| 7 | + const notes = section.querySelectorAll("li"); |
7 | 8 |
|
8 | | - for (const note of notes) { |
9 | | - const content = note.querySelector("p") as HTMLParagraphElement; |
| 9 | + for (const note of notes) { |
| 10 | + const content = note.querySelector("p") as HTMLParagraphElement; |
10 | 11 |
|
11 | | - const fnrefs = document.querySelectorAll<HTMLAnchorElement>( |
12 | | - `a[id^='${note.id.replace("fn", "fnref")}']`, |
13 | | - ); |
| 12 | + const fnrefs = document.querySelectorAll<HTMLAnchorElement>( |
| 13 | + `a[id^='${note.id.replace("fn", "fnref")}']`, |
| 14 | + ); |
14 | 15 |
|
15 | | - for (const fnref of fnrefs) { |
16 | | - addTooltip(fnref, content.innerHTML); |
| 16 | + for (const fnref of fnrefs) { |
| 17 | + addTooltip(fnref, content.innerHTML); |
17 | 18 |
|
18 | | - fnref.classList.add("footnote"); |
| 19 | + fnref.classList.add("footnote"); |
19 | 20 |
|
20 | | - fnref.setAttribute("tabindex", "0"); |
21 | | - fnref.removeAttribute("href"); |
| 21 | + fnref.setAttribute("tabindex", "0"); |
| 22 | + fnref.removeAttribute("href"); |
| 23 | + } |
22 | 24 | } |
23 | | - } |
24 | 25 |
|
25 | | - footnotes.remove(); |
| 26 | + section.remove(); |
| 27 | + } |
26 | 28 | } |
0 commit comments