Skip to content

Commit

Permalink
Don't make arrow labels for annotation refs
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasl committed Sep 23, 2024
1 parent dffad7b commit 6cabd8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions demo/arrows.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ export function renderArrows(container) {
let arrow = document.createElementNS(SVGNS, 'path')
arrow.classList.add('arrow')

if (link.parentNode.classList.contains('annotation')) {
const isAnnotation = link.parentNode.classList.contains('annotation')

if (isAnnotation) {
arrow.classList.add('rei')
}

let arrowLabel
let label = link.parentNode.closest(
let label = isAnnotation ? null : link.parentNode.closest(
'article > p:has(>b), article > div:has(>b), div > p:has(>b), div:has(>b)'
)?.querySelector('b')
if (label) {
Expand Down

0 comments on commit 6cabd8a

Please sign in to comment.