Skip to main content
100%

Example table of contents generated by markdown-toc, correctly links repeated headings.

✓ Published0🌍 Public
Aabernier
Last edited Dec 15, 2015
Created on May 9, 2018

This example demonstrates how the markdown-toc library generates a table of contents for a Markdown file containing repeated headings. It shows the resulting TOC structure with nested list items and anchor links, where each repeated heading receives a unique suffix (such as `#heading-1` and `#heading-2`) to ensure correct linking. The code uses markdown-toc to parse the heading levels and output the TOC, while the source content is a fixture with three identical sets of h1, h2, and h3 headings. The rendering approach is plain text output, highlighting the library's handling of duplicate heading anchors.

AI-generated description

Similar vizzes