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:
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…
Reference in New Issue
Block a user