Two easy ways. If the ToC heading is always the first H2 on the page, just drop it from the array:
var headings = [].slice.call(documentRef.body.querySelectorAll('h2')).slice(1);
A sturdier option is to skip any H2 that sits inside the ToC container itself, so it keeps working even if the page order changes:
var headings = [].slice.call(documentRef.body.querySelectorAll('h2')).filter(function (h) {
return !toc.contains(h);
});
Use one or the other. If the ToC heading isn’t inside #toc, give it a class (for example class=“toc-title”) and use querySelectorAll(‘h2:not(.toc-title)’) instead.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Accessibility regression after update — <ul class="x-menu"> has role="navigation" causing Lighthouse list errors | 0 | 10.75 | 18-09-2026 |
| 2 | hiddenswitch - 404: page not found | 0 | 35.1 | 19-10-2026 |
| 3 | Class specific to cornerstone editor | 0 | 6.62 | 18-09-2026 |
| 4 | highlight - 404: page not found | 0 | 34.8 | 19-10-2026 |
| 5 | Image Widget overlay caption stays visible on hover in stretched row | 0 | 6.32 | 07-10-2026 |
| 6 | youtracklinks - 404: page not found | 0 | 34.74 | 19-10-2026 |
| 7 | HTML и CSS из прошлого, которые до сих пор актуальны | 0 | 6.24 | 13-10-2026 |
| 8 | playground | 0 | 30.04 | 20-10-2026 |
| 9 | sequencediagram - 404: page not found | 0 | 35.65 | 19-10-2026 |