From 4f182a115b0a3a6d4b6b2ba46abe3c4e71cfda5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 25 Jan 2025 14:27:23 +0100 Subject: [PATCH] headings: add anchor link if nested shortcode #992 --- 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 ddcbf33c02..d46433eb71 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.3.1+8dad5ee419e5bb2a0b380aa72d7a7389af4945f6 \ No newline at end of file +7.3.1+93b32c1672553781d911855cb9b8f106626a216e \ No newline at end of file diff --git a/static/js/theme.js b/static/js/theme.js index 4869b105b7..e3eb06d132 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -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');