Support Reference Links in Edit mode/Live Preview (reference-style)

Would like to add another vote for fixing Obsidians handling of reference links.

As a nvim user markdown reference links are a life-saver due to vim/nvim’s decades long issues with text concealment.

The issue with reference links not working in Edit Mode could be tolerable when using Obsidian mostly for viewing notes and occasionally editing them on a mobile .

But the issue with internal reference links being treated as external links completely breaks down all internal link usage in my vault.

1 Like

Reference style links are a major feature of Markdown and make source text more readable. I expect they’re less commonly used because inline links are simpler, and less commonly well-supported by apps for the same reason, but it’s still kind of upsetting that they’re so broken here.

5 Likes

@CawlinTeffid I feel the same but… s/kind of/extremely/

1 Like

Still happens in v1.6.1 on Windows
The reference links are not listed in the user documentation, but are part of the Common Mark spec (Basic Syntax | Markdown Guide)

To summarize, there is full support of reference links in preview mode, even with advanced features

This displays perfectly:

[Libération, with a reference link][2]
[2]: http://www.liberation.fr "journal libération"

But in source edit the command “follow link under cursor” does not work

  • if the cursor is in the link text, it opens/creates a note named [ in the default folder for new notes
  • if the cursor is the link destination, it opens/creates a note named 2 in the default folder

This is really appears as bug to me, because :

  • the second part of the reference link, starting with [2]: is properly formatted in edit view, and perfectly functional in preview (even with the optional title)
  • if reference links were not supported, this notation should not be recognised as a link at all, and the command “follow link under cursor” should not be available.
  • although it is an external link, Obsidian behaves like it is internal and opens/creates a note

The problem is that it makes reference links nearly impossible to use.

Thanks a lot for you amazing work

3 Likes

This is so old I forgot it had been opened a few times already. Is this any closer to getting fixed after 2 1/2 years?

1 Like

Man I am so tired of deleting these [ files all the time. Another multi-year bug that really deserves some attention. >4.1k views and 68 :purple_heart:s in this topic, but this is still broken in 1.7.4.

2 Likes

Just wanna add that it’s rather frustrating that this issue is seen as low-priority, since it’s basic markdown syntax that’s not supported.

Being able to sort out links in Markdown is pretty important and this is part of that.

3 Likes

I am looking for the same.

What surprises me is that no one has made a plugin that fixes/patches/worksaround this, or is it not possible?

Of course a proper fix should be implemented in the app itself, but for the meantime? (since nothing seems to be happening with this anyway)

Obsidian v1.8 will implement reference style links in live preview for external links.
Reference style Internal links are not supported in any mode.

2 Likes

Will this work in mobile also?

@WhiteNoise
I see it listed in the release notes for desktop (Obsidian 1.8.0 Desktop (Early access) - Obsidian) but not for mobile (Obsidian 1.8.0 Mobile (Early access) - Obsidian). It really have to be sorted out in both environments. Please do not let mobile linger.

The current behaviour (create a [.md file) exists on mobile, and whereas i am able to create a custom plugin to prevent this behaviour on desktop (…which should be obsolete with 1.8.0) i am not succesful with prevent this on mobile (as described here)

Yes, the same fix will be available on mobile.