Merge pull request #2371 from mindrones/site-fix-2365

Don't update the active section for headings above level 3
pull/2381/head
Rich Harris 6 years ago committed by GitHub
commit 1dc787493a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -125,7 +125,7 @@ export default function() {
return `
<h${level}>
<span id="${slug}" class="offset-anchor"></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}>`;

@ -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-scrollignore])');
let positions;
const onresize = () => {

Loading…
Cancel
Save