Skip to content

Commit

Permalink
Pass biome
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Oct 8, 2024
1 parent 79d897e commit fd14565
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions bun/backref.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)
}
}

0 comments on commit fd14565

Please sign in to comment.