UNPKG

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
<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 &lt;span&gt;1&lt;/span&gt;</a></li><li><a href="#sub-heading-2">Sub heading 2</a></li></ul></li></ul></div> <h2>Sub heading &lt;span&gt;1&lt;/span&gt;</h2> <p>Some nice text</p> <h2>Sub heading 2</h2> <p>Some even nicer text</p>