By default, Astro adds an h2 heading called “Footnotes” when you use footnotes in Markdown/MDX. To remove it, you can update the generateToc like this:
export function generateToc( headings: readonly MarkdownHeading[], minHeadingLevel: HeadingLevel, maxHeadingLevel: HeadingLevel) { ... const bodyHeadings = headings.filter( ({ depth }) => depth >= minHeadingLevel && depth <= maxHeadingLevel ({ depth , text}) => depth >= minHeadingLevel && depth <= maxHeadingLevel && text !== 'Footnotes' ) ...}Or modify it to suit your needs.