0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

use data-scrollignore rather than being level specific

This commit is contained in:
Luca Bonavita 2019-04-07 17:41:46 +01:00
parent 888e16367c
commit 4b40882f45
2 changed files with 2 additions and 2 deletions

View File

@ -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}>`;

View File

@ -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;