mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-13 07:13:29 +00:00
children: only set anchors on headings if they contain an id #1015
This commit is contained in:
parent
f39096c62b
commit
34db6f0dd7
2 changed files with 2 additions and 2 deletions
|
@ -1 +1 @@
|
|||
7.3.2+a6379dcc8ca63ec8eafe10c1919fd69ce1397bf2
|
||||
7.3.2+f39096c62ba3057ba2082e140809b752f88b3cb7
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Reference in a new issue