From fd1456507c2917dbebddd6f3015e0eea5f3eebd6 Mon Sep 17 00:00:00 2001 From: utensil Date: Tue, 8 Oct 2024 14:11:13 +0800 Subject: [PATCH] Pass biome --- bun/backref.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bun/backref.js b/bun/backref.js index 19893e0..8d01dbb 100644 --- a/bun/backref.js +++ b/bun/backref.js @@ -6,10 +6,15 @@ for (const citation of citations) { const href = citation.getAttribute('href') citation_map[href] = citation_map[href] || 0 const citation_id = ++citation_map[href] - citation.setAttribute('id', `ref-${href.replace('.xml', '')}-${citation_id}`) + citation.setAttribute( + 'id', + `ref-${href.replace('.xml', '')}-${citation_id}`, + ) } -const references = document.querySelectorAll('article footer section[data-taxon="Reference"] details summary header h1 a') +const references = document.querySelectorAll( + 'article footer section[data-taxon="Reference"] details summary header h1 a', +) for (const reference of references) { const href = reference.getAttribute('href') @@ -18,8 +23,14 @@ for (const reference of references) { // create a back reference const back_reference = document.createElement('a') back_reference.textContent = '↩' - back_reference.setAttribute('href', `#ref-${href.replace('.xml', '')}-${i}`) - back_reference.setAttribute('style', 'color: var(--uts-text-gentle) !important;text-decoration: none; margin-left: 0.5ex; margin-right: 0.5ex;') + back_reference.setAttribute( + 'href', + `#ref-${href.replace('.xml', '')}-${i}`, + ) + back_reference.setAttribute( + 'style', + 'color: var(--uts-text-gentle) !important;text-decoration: none; margin-left: 0.5ex; margin-right: 0.5ex;', + ) reference.parentElement?.parentElement?.appendChild(back_reference) } }