headings: add anchor link if nested shortcode #992
Some checks are pending
docs-build-deployment / Run deploy (push) Waiting to run
docs-build / Run build (push) Waiting to run

This commit is contained in:
Sören Weber 2025-01-25 14:27:23 +01:00
parent 93b32c1672
commit 4f182a115b
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 2 additions and 2 deletions

View file

@ -1 +1 @@
7.3.1+8dad5ee419e5bb2a0b380aa72d7a7389af4945f6
7.3.1+93b32c1672553781d911855cb9b8f106626a216e

View file

@ -527,7 +527,7 @@ function initAnchorClipboard() {
return;
}
document.querySelectorAll('h1~h2,h1~h3,h1~h4,h1~h5,h1~h6').forEach(function (element) {
document.querySelectorAll(':has(h1) :is(h2,h3,h4,h5,h6').forEach(function (element) {
var url = encodeURI((document.location.origin == 'null' ? document.location.protocol + '//' + document.location.host : document.location.origin) + document.location.pathname);
var link = url + '#' + element.id;
var new_element = document.createElement('button');