From 34db6f0dd729d16b6139b1c3bbe61d9ca3d0976b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 11 Feb 2025 17:22:27 +0100 Subject: [PATCH] children: only set anchors on headings if they contain an id #1015 --- layouts/partials/version.txt | 2 +- static/js/theme.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index bbd8c74425..9b9fe05b70 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.3.2+a6379dcc8ca63ec8eafe10c1919fd69ce1397bf2 \ No newline at end of file +7.3.2+f39096c62ba3057ba2082e140809b752f88b3cb7 \ No newline at end of file diff --git a/static/js/theme.js b/static/js/theme.js index b93432a529..22661749b7 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -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');