huntertran / markdown-toc

Auto MarkdownTOC (Table Of Contents) plugin for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=huntertran.auto-markdown-toc
MIT License
39 stars 25 forks source link

"depthFrom" setting ignored for section numbering (since v2.1.0?) #18

Open awesometown opened 4 years ago

awesometown commented 4 years ago

Section 3.2 of the README.md says "Tips:Section of header is begin with depthFrom", and the image shows header numbers being generated starting at the second level. That is, with depthFrom:2 and given the input:

# Title
## Section
### Subsection

I would expect output:

# Title
## 1. Section
### 1.1 Subsection

It appears things worked this way in version 2.0.0, but as far as I can tell stopped working in 2.1.0. Given the same input as above, the output in all newer versions is:

# 1. Title
## 1.1 Section
### 1.1.1 Subsection
huntertran commented 4 years ago

I will comeback to this on this holiday

damianh commented 4 years ago

This is an annoying regression. Look forward to a fix.

Is it possible to install a previous version?

terrisgit commented 4 years ago

Adding numbers seems to be broken in the current release. I've tried "insert/update sections" in addition to generating the TOC. I'm not getting any section numbers. From is 1 and To is 6.

livepdm commented 4 years ago

I have solved this issue. because usually only one header at level 1. so I changed the code to force the order action start from level 2 or deeper level.

I forked 3.0.3 and push this repos. but it seems not takes effect.

I'm a beginner of Git, please contact me at alex#livepdm.com if needed.

huntertran commented 4 years ago

@livepdm Thank you for your work 😄 . You edited a number of files. I need to test them carefully before merge to master branch. Currently, I busy with my studies. I will come back to this when I have spare time.