Improve footnotes in headings

Steps to reproduce

  1. create a note and input two h1 headings
    ‘# test h1 with footnote[^1]
    ’# test h1 with footnote[^2][^3]

  2. creat another note and create link refer to h1 headings above
    ![[footnote bug#test h1 with footnote[ 2][ 3]]]
    Ref:安装 WSL | Microsoft文档WSL 基本命令 | Microsoft LearnWSL 高级设置 | Microsoft Learn

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

y

Expected result

Plz solve the three problems mentioned below

Actual result

The following issues can be reproduced in a sandbox environment:

  1. When a heading with a footnote is set as a link, the last bracket of the link becomes isolated. I will attach two images showing this issue in both preview and non-preview link modes.
    image
    image
  2. When a heading title has two or more footnotes, if the link refer to that heading is in preview mode, and there is a hyperlink in the subsequent text of the article which using this link. a “failed to load image” icon will appear at the location of the hyperlink.
    image
  3. When entering a link refer to headings with footnotes, if it is selected from a popup after typing [[Note Name#]], there will be meaningless spaces before the number in the footnote (It is estimated that the ^ in the footnote syntax is not displayed properly). Deleting the spaces does not affect the normal referencing of the double-bracket link. Refer to the images above for examples.

Environment

SYSTEM INFO:
Obsidian version: v1.5.12
Installer version: v1.5.12
Operating system: Windows 10 Pro 10.0.19045
Login status: not logged in
Insider build toggle: off
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

Sorry for posting two identical bug reports, the format of the previous bug report was incorrect, this is a rewritten version, could administrator delete the previous one? Thank you.

Another small question about headings with footnotes is: If footnotes are added to headings such as H2 titles within the note, the table of contents in the sidebar does not display these footnotes correctly but instead adds a number.

This neither realizes the function of footnotes nor is beautiful at all. I suggest removing the footnotes directly from the side table of contents because people do not need to use the footnote function in the side table of contents.

  1. Okay
  2. Okay
  3. is not necessarily a bug.
  4. maybe we can improve on the outline

Thanks a lot for your hard work :kissing_heart: