Footnotes do not render correctly with markdown links

Steps to reproduce

  1. Create a markdown link ([visible text](http://example.com))
  2. Insert a footnote ([visible[^1] text](http://example.com))
  3. Go into reading view and see that the formatting has broken

Expected result

The footnote is rendered properly

Actual result

The footnote is not superscripted, and halts rendering the rest of the text with the link (e.g., (“text” in the examples above is not rendered with a link)

Environment

SYSTEM INFO:
	Obsidian version: 1.14.5
	Installer version: 1.14.5
	Operating system: 7.2.11-arch1-1
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 1
	Restricted mode: off
	Plugins installed: 6
	Plugins enabled: 3
		1: Templater v2.20.6
		2: Image Toolkit v1.4.3
		3: Scroll Offset v1.0.4

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

LINUX ONLY: 
Distro Name: Arch
Kernel Version: 7.2.11-arch1-1
Desktop Environment: KDE
Installation method used: Appimage

Additional information


How would you expect this to work? If you put a footnote in link text, it needs to point to 2 different places at once (the link target and the footnote), which it can’t do.

Apply the formatting for the entire text (instead of cutting it at the footnote), and somehow switching where it points to for fully enclosed blocks of linked text (in this case, footnotes, but I discovered that internal links have the same issue). I wouldn’t know how technically difficult it would be to implement, maybe have the footnote basically be “above” the larger link? I think it would be possible without sacrificing UX

It seems unlikely to me that enough people would want to do this often — or ever — to justify designing a solution as part of the core app. Do you know of any other apps that support behavior like this?

Also the CommonMark specification on which Obsidian’s Markdown is ultimately based, forbids links in links:

Links may not contain other links, at any level of nesting. If multiple otherwise valid link definitions appear nested inside each other, the inner-most definition is used. (CommonMark Spec)

CommonMark doesn’t have footnotes but I imagine they would treat them the same way since they’re functionally very similar. By that reasoning, Obsidian should activate the footnote and not activate the link (and show the link’s brackets and URL), so altho I disagree with your proposed solution I think you did find a bug after all (tho the team might consider it a feature request).

If my proposition breaks specification, then it would at least be nice if it were to fallback to something a little less “broken” looking, even if it were to just render it as the raw text. It’s certainly not a common situation, but it did happen to me naturally and wasn’t some theoretical scenario, so there is probably a non-zero chance someone else could stumble upon it as well

Yes, I agree now that it should do something different than what it does.