mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-22 08:40:32 +00:00
headings: add anchor link if nested shortcode #992
This commit is contained in:
parent
93b32c1672
commit
4f182a115b
2 changed files with 2 additions and 2 deletions
static/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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue