prepend source for accessibility

This commit is contained in:
welpo 2024-05-03 17:27:17 +02:00
parent 9dd9492f13
commit 9055b1ad75
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ document.addEventListener("DOMContentLoaded", function() {
if (sourceUrl.startsWith('http')) {
sourceElement.href = sourceUrl;
}
codeElement.appendChild(sourceElement);
codeElement.prepend(sourceElement);
}
}
});

View file

@ -1 +1 @@
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".code-source").forEach(function(t){var e,n=t.getAttribute("data-source"),t=t.nextElementSibling;t&&"PRE"===t.tagName&&(t=t.querySelector("code"))&&((e=document.createElement(n.startsWith("http")?"a":"span")).textContent=n,e.className="source-path",n.startsWith("http")&&(e.href=n),t.appendChild(e))})});
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".code-source").forEach(function(t){var e,n=t.getAttribute("data-source"),t=t.nextElementSibling;t&&"PRE"===t.tagName&&(t=t.querySelector("code"))&&((e=document.createElement(n.startsWith("http")?"a":"span")).textContent=n,e.className="source-path",n.startsWith("http")&&(e.href=n),t.prepend(e))})});