Closed Princesseuh closed 3 years ago
This fix #5 by allowing users to add a list of items to filter out when constructing the labels for the toc.
It works like so:
const toc = new Toc(` <h1>Page Title</h1> <h2 id="section1">Section 1</h2> <h2 id="section2">Section 2 <a class="permalink">#</a></h2> `, {ignoredElements: ['.permalink']})
result in the following html:
<ol> <li> <a href="#section1">Section 1</a> </li> <li> <a href="#section2">Section 2</a> </li> </ol>
Before this PR, it would have resulted in Section 2 being Section 2 # instead of Section 2. Tests have been added and the README has been edited.
Section 2 #
This looks great. Thanks @Princesseuh
This fix #5 by allowing users to add a list of items to filter out when constructing the labels for the toc.
It works like so:
result in the following html:
Before this PR, it would have resulted in Section 2 being
Section 2 #
instead of Section 2. Tests have been added and the README has been edited.