markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

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

Open awesometown opened this issue 5 years ago • 5 comments

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

awesometown avatar Dec 03 '19 19:12 awesometown

I will comeback to this on this holiday

huntertran avatar Dec 09 '19 18:12 huntertran

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

Is it possible to install a previous version?

damianh avatar Feb 04 '20 10:02 damianh

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.

terrisgit avatar Feb 19 '20 20:02 terrisgit

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.

livepdm avatar Feb 28 '20 08:02 livepdm

@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.

huntertran avatar Mar 03 '20 19:03 huntertran