onlyafly / number-headings-obsidian

Automatically number headings in a document in Obsidian
MIT License
113 stars 11 forks source link

Reset number when #13

Closed tombroens closed 2 years ago

tombroens commented 2 years ago

Love your plugin but there is a snag....

When the option 'Skip top heading level' is active. The behaviour is a bit unexpected. I would expect the follow heading (##) to start at 1 every time there is a new heading 1 (#). E.g. now numbering results in this:

# Heading 1
## 1 Heading 2
### 1.1 Heading 3
### 1.2 Heading 3
## 2 Heading 2
### 2.1 Heading 3
### 2.2 Heading 3
## 3 Heading 2
### 3.1 Heading 3
### 3.2 Heading 3

# Heading 1
## 4 Heading 2
### 4.1 Heading 3
### 4.2 Heading 3
## 5 Heading 2
### 5.1 Heading 3
### 5.2 Heading 3

while I would expect this:


# Heading 1
## 1 Heading 2
### 1.1 Heading 3
### 1.2 Heading 3
## 2 Heading 2
### 2.1 Heading 3
### 2.2 Heading 3
## 3 Heading 2
### 3.1 Heading 3
### 3.2 Heading 3

# Heading 1
## 1 Heading 2
### 1.1 Heading 3
### 1.2 Heading 3
## 2 Heading 2
### 2.1 Heading 3
### 2.2 Heading 3

Am I missing something? Maybe add an option 'Reset counter after every top heading"?
onlyafly commented 2 years ago

Good point. I can see how that would be useful. I'll look into it.

onlyafly commented 2 years ago

Fixed in 1.9.0