Docker-Docs/js/anchorlinks.js

9 lines
263 B
JavaScript

(function (d) {
"use strict";
for (const h of d.querySelectorAll("H1, H2, H3")) {
if (h.id != null && h.id.length > 0) {
h.insertAdjacentHTML('beforeend', `<a href="#${h.id}" class="anchorLink">🔗</a>`)
}
}
})(document);