nok / markdown-toc

Generate and update magically a table of contents based on the headlines of a parsed markdown file.
MIT License
68 stars 37 forks source link

Produces Nan on ordered lists if nested #98

Open M-Fabian opened 7 years ago

M-Fabian commented 7 years ago

The following document shows the problem. How to reproduce:

  1. Paste text below (without the table of contents)
  2. Add TOC
  3. change depthFrom to 3 and orderedList to 1
  4. Save.

MyDocument

  1. Paragraph
  2. Another Paragraph NaN. Subparagraph

Paragraph

bla

Another Paragraph

bla

Subparagraph

bla

rabelux commented 7 years ago

Confirming this. Have the same issue in a different file where is use depthfrom: 2

werunom commented 6 years ago

Have similar issue. But NaN appears only for 5th heading level. Below is the illustration for ordered list...

4. H2 heading
    1. H3 heading
        1. H4 heading
            NaN. H5 heading
            NaN. H5 heading
            NaN. H5 heading

Let me know if you need more info.