markdown-it-table-of-contents
Version:
A Markdown-it plugin for adding a table of contents to markdown documents
8 lines (7 loc) • 436 B
HTML
<h1>An article</h1>
<p>some text with soft break before toc</p>
<div class="table-of-contents"><ul><li><a href="#an-article">An article</a><ul><li><a href="#sub-heading-%3Cspan%3E1%3C%2Fspan%3E">Sub heading <span>1</span></a></li><li><a href="#sub-heading-2">Sub heading 2</a></li></ul></li></ul></div>
<h2>Sub heading <span>1</span></h2>
<p>Some nice text</p>
<h2>Sub heading 2</h2>
<p>Some even nicer text</p>