fix: anchor links
Some checks are pending
Build & run tests / Node 20 (push) Waiting to run
Build & run tests / Node 18 (push) Waiting to run
Build & run tests / Node 22 (push) Waiting to run
Lint / Lint files (push) Waiting to run

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2024-09-01 11:06:20 +02:00
parent 1b91232909
commit c543dc1f23

View file

@ -847,7 +847,7 @@ const anchorForId = id => {
const anchor = document.createElement('a')
anchor.ariaHidden = 'true'
anchor.className = 'anchor hidden-xs'
anchor.href = `${document.location.origin}${document.location.pathname}#${id}`
anchor.href = new URL(`#${id}`, document.location).toString()
anchor.innerHTML = '<i class="fa fa-link"></i>'
anchor.title = id
return anchor