@@ -354,10 +354,12 @@ window.addEventListener("scroll", event => {
355 all.forEach(link => {
355 all.forEach(link => {
356 let section = document.querySelector(link.hash);
356 let section = document.querySelector(link.hash);
357+ let sectionChildren = document.querySelector(link.hash).nextElementSibling;
359− section.offsetTop <= fromTop &&
360+ ((section.offsetTop <= fromTop) ||
361+ (sectionChildren.offsetTop <= fromTop)) &&
360− section.offsetTop + section.offsetHeight > fromTop
362+ (section.offsetTop + section.offsetHeight + sectionChildren.offsetHeight > fromTop)
362 link.classList.add("current");
364 link.classList.add("current");