Don't update the active section for headings below level 3

Fixes #2365
pull/2371/head
Luca Bonavita 6 years ago
parent 92b66a313e
commit 888e16367c

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

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

Loading…
Cancel
Save