use `data-scrollignore` rather than being level specific

pull/2371/head
Luca Bonavita 6 years ago
parent 888e16367c
commit 4b40882f45

@ -125,7 +125,7 @@ export default function() {
return `
<h${level}>
<span id="${slug}" class="offset-anchor" ${level === 4 ? 'data-level=4' : ''}></span>
<span id="${slug}" class="offset-anchor" ${level > 3 ? 'data-scrollignore' : ''}></span>
<a href="docs#${slug}" class="anchor" aria-hidden="true"></a>
${text}
</h${level}>`;

@ -19,7 +19,7 @@
onMount(() => {
// don't update `active_section` for headings below level 3, see _sections.js
const anchors = container.querySelectorAll('[id]:not([data-level="4"])');
const anchors = container.querySelectorAll('[id]:not([data-scrollignore])');
let positions;

Loading…
Cancel
Save