onlyafly / number-headings-obsidian

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

Incorrect numbering for nested headings when top-level heading is unnumbered #48

Closed InvisOn closed 11 months ago

InvisOn commented 1 year ago

Problem Description

I am unsure whether this is intended behaviour or a bug. I would like the top level not to be numbered but to have the lower level headings be numbered as if the top level heading was numbered.

Expectations

# heading 1

## 1.1 Contents ^toc

- [[#heading 1|heading 1]]
    - [[#1.1 Contents ^toc|1.1 Contents]]
- [[#heading 2|heading 2]]
    - [[#2.1 sub 1|2.1 sub 1]]
        - [[#2.1.1 sub 2|2.1.1 sub 2]]

# heading 2

## 2.1. sub 1

### 2.1.1. sub 2

Actual Result

# heading 1

## 1. Contents ^toc

- [[#heading 1|heading 1]]
    - [[#1. Contents ^toc|1. Contents]]
- [[#heading 2|heading 2]]
    - [[#1. sub 1|1. sub 1]]
        - [[#1.1. sub 2|1.1. sub 2]]

# heading 2

## 1. sub 1

### 1.1. sub 2

Settings Used

image

Other settings I tried to get the desired result

image

And

image

Version Information

onlyafly commented 11 months ago

This is solvable by using the "first-level 2" setting.

For example, use this in the front matter:

number headings: auto, first-level 2