Originally Posted by nickredding
Those toc type index entries ensure that the index entries for the sections have an offset and length that includes the inline section TOC that is inserted into the markup. Without them, I believe the index entries for the sections would have an offset at the beginning of the first article in the section, not the TOC, and the section length would not include the TOC.
Are you sure they're necessary? Looking at the code, the section offset is set independently of the offset of the first article in the section and the length is set as next_section.offset - section.offset