Link renaming fails if latex equations are not on separate lines

Steps to reproduce

  • Create a file A.md
  • Create a file B.md and insert the following into it:
$$
P(A)
$$$$
P(A)
$$

[A](A.md)
  • Rename A.md to anything
  • The link to A.md in B.md will not have updated

If you then insert a newline character between the two sets of $$ the link renaming will work as expected.

Weirdly though this doesn’t appear to be an issue for the interactive viewer as in it will display both equations fine

Did you follow the troubleshooting guide?

Y - Was able to replicate this bug in the sandbox

Expected result

I wanted the link to A.md to be updated to the new name

Actual result

The Link to A.md in B.md was not updated

Environment

SYSTEM INFO:
	Obsidian version: v1.4.14
	Installer version: v1.4.13
	Operating system: Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 22.4.0
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: none
	Snippets enabled: 1
	Restricted mode: off
	Plugins installed: 5
	Plugins enabled: 0

Additional information

Linked file settings:

Just to add that it appears to be bugged if any text is added onto the end of the equation for example this triggers it as well:

$$
P
$$sometext

[A](A.md)

This is particularly difficult to spot / deal with because in live preview mode as there is no clue that it is formatted like this: