How Obsidian works with reference to the header?

I have a link in my note [[Test#Part2]]. It is obvious that it leads to the title of Part 2 in the article Test.
And where will it lead if Test has such a structure

# Ver1
....
## Part2
...
# Ver2
....
## Part2

Which Part 2 will be referenced. This is an important question when working with versions of a single document.

[[File#Ver1#Part2]]

[[File#Ver2#Part2]]

Iā€™m rather wondering if I can use [[File#Part 2]] to permanently link to the current version in such a note structure

# FileName
...
## Part2
...
# OldVersion
...
## Part2

in case of ambiguity, we match the first one encountered.

1 Like