children: only set anchors on headings if they contain an id #1015

This commit is contained in:
Sören Weber 2025-02-11 17:22:27 +01:00
parent f39096c62b
commit 34db6f0dd7
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.2+a6379dcc8ca63ec8eafe10c1919fd69ce1397bf2
7.3.2+f39096c62ba3057ba2082e140809b752f88b3cb7

View file

@ -538,7 +538,7 @@ function initAnchorClipboard() {
return;
}
document.querySelectorAll(':has(h1) :is(h2,h3,h4,h5,h6').forEach(function (element) {
document.querySelectorAll(':has(h1) :is(h2[id], h3[id], h4[id] , h5[id], h6[id])').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');