Outline view focusing on a wrong line in reading view if the note has a footnote

Steps to reproduce

  1. In the sandbox vault, create a new note with the following content:
Hello, world [^1].

[^1]: This is a footnote.

# This is the line that I want to focus on. 

  1. Switch to reading view.
  2. Open the outline view, and the click “This is the line that I want to focus on.”

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

The line with the heading should be highlighted.

Actual result

The footnote is highlighted.

Screen Recording 2025-02-11 at 19.18.38

Environment

SYSTEM INFO:
Obsidian version: v1.8.5
Installer version: v1.8.4
Operating system: Darwin Kernel Version 22.6.0: Mon Feb 19 19:43:41 PST 2024; root:xnu-8796.141.3.704.6~1/RELEASE_ARM64_T8103 22.6.0
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0

RECOMMENDATIONS:
none


Additional information

I first encountered a similar issue when I was developing a plugin, and I posted a question in the developers category.
I believe this bug share the same root cause as the problem that I described in the original thread:

If we add some line after the heading, then it works as expected, and this phenomenon was also observed in the linked thread.

thanks. I can reproduce this only if the heading is the last line of the note.