List unresolved links as unlinked mentions

Use case or problem

In my notes, I often put square brackets around important concepts so that once I create a note on that concept, those notes will already be linked to that new note. But sometimes that note ends up getting a different name and the term previously used in square brackets will be an alias.

The problem is that the previous mentions of that that alias will not show up under “unlinked mentions” because they have square brackets around them, i.e. they appear to be linked.

A simple example would be names of people: Let’s say I mention [[John Doe]] in many notes but when I eventually create a note with his name, it is actually called “John Tucker Doe”. So I put “John Doe” as an alias in the notes frontmatter. As a result, all occurrences of “John Doe” will be shown under “unlinked mentions” and I can turn them into links.

The problem is that occurrences of [[John Doe]] will not show up as unlinked mentions, making it very difficult to get those mentions directed to the note entitled John Tucker Doe.

Proposed solution

Make it so that Unlinked mentions also include not just occurences of the note’s alias(es) but also the notes’s alias(es) in square brackets.

It is probably advisable to limit this behaviour to aliases for which no synonymous file names exist so that links to existing files are not listed (and potentially broken). In other words: only unresolved links should be listed as unlinked mentions.

Current workaround (optional)

Sometimes I can work around this by renaming the new note to the alias and then restoring the original name. But most of the time, this is not an option because it will change the text in the linked notes to the name of the new note instead of creating an alias link.

Related feature requests (optional)

Given links to to a nonexistent note named “John Doe” that you want to point to existing note “John Tucker Doe”:

  1. Make an empty note named “John Doe”.
  2. In the note menu (3 dots in upper right) of the “John Doe” note, select “Merge entire file with…”
    • (if you don’t see this, turn on Settings > Core Plugins > Note Composer and try again).
  3. Select “John Tucker Doe”.

Your “John Doe” links should now be “John Tucker Doe” links.

Does this do anything different than

i.e. to rename the note John Tucker Doe to John Doe and then back to John Tucker Doe?

(I guess I’ll try it…)

Edit: As far as I can see, this does the same as my existing workaround, i.e. it is of limited use because it is destructive in the sense that

Ah, right, sorry.

There’s a feature request to use aliases when merging, if you’d like to upvote it.

I don’t know of a community plugin that addresses that case, but I’ll look when I have a chance. One that lets you choose whether or not to alias each link would be very handy (tho you wouldn’t need that option here).

I don’t see anything relevant in Community Plugins when searching “alias” or “merge”.

No, neither did I. Thanks for checking!

I think this (together with this) really is a design flaw/shortcoming in obsidian core. Not sure it makes sense to try and work around that via plugins. Unless I fail to grasp some design principle that requires the current way of handling aliases, I’d say that Obsidian’s implementation of aliases is incompmlete and I would almost assume that fixing this already is on some roadmap.

The challenge may well be that there are probably varied ways of using aliases at the same time as aliases are widely used so that changing the core behaviour to fix the above problem may break something in some other use case.

But so far, I have failed to imagine such a use case. Can you come up with a scenario in which the propsed solution might lead to problems?

I see the use case, but I’d guess it’s not an urgent problem for most people. If it’s not on the roadmap and you urgently want the feature, I’d say working around makes sense.

The main problem I see is that including links in “unlinked mentions” is bound to confuse people. I see value in having a separate feature or plugin to list unresolved links that match aliases.

A complication is the case where multiple notes have the same alias — for example, notes about 3 people who are all nicknamed “Bob”.

A possible workaround for now: List linked-but-not-linked aliases by searching "[[John Doe]]", then use an external app to do a vault-wide search-replace.

First I thought: hmm, you have a point. Didn’t think of that. But then: those are not really links (since they are not linking to anything) at least if you

If only “unlinked links” are shown as unlinked mentions, I don’t see how people would be confused.

This complication is not specific to my suggestion. It exists already with unlinked mentions as we have them today.

I can have three notes with the alias “Bob” and in each of them I get to see all mentions of Bob under unlinked mentions and in each note I can choose which of those Bobs to convert into a linked mention. This works fine and nothing would change if also all mentions of [[Bob]] were listed under unlinked mentions.

There is no problem.

I’m not sure what I’m suppose to search and replace? Replace all “[[John Doe]]” with “John Doe”?

What would be the advantage over

A link is a link. Regardless of whether you reach anything at the other end, the text has been marked as a link. It’s not unlinked (if it doesn’t go anywhere yet, it’s “unresolved”).

I thought you wanted to replace [[John Doe]] with [[John Tucker Doe|John Doe]] in some cases.

I could be reading this wrong, but if you change any link name, that change will change all occurrences of that link.

You might find clarity in this from the help vault:

Fine. Thanks for clarifying the language. I have added the clarification to the OP and title.

So the question is whether people would be confused if unresolved links would be listed under unlinked mentions and I don’t think so. It makes intuitive sense.

Yes. So how do I do that with some external tool? Even if I wanted to convert all occurrences of [[John Doe]], using an external tool seems rather complicated to me.

I suppose you mean if you change the name of a note, then all links pointing to that note will be changed to point to the note’s new name? If so, that would be the workaround suggested in the OP, which comes with the downside that it is destructive in the sense that it changes the text in the notes containing the link (rather than modifying the link to become an alias link).

  • A linked mention in a note is where text is referenced by link to another note or a header or block in the current note.|

  • An unlinked mention is unadorned text in the current note that actually has note with that name.

  • As @CawlinTeffid indicated, a link is a link; it is a defined connection. If you want to give it a different name where it is used, enter a pipe symbol ( | ) as he indicated [[John Tucker Doe|John Doe]]. This is not an alias, but called DisplayText. It only displays for the individual link it is used in.

  • An unlinked mention is text (but there is a note with that name). It is not formally linked. They are potential links just waiting to be formally created:)

I’m sorry, I don’t think the developers will include links in the list of unlinked text. A separate list seems much more likely.

It’s like normal search and replace except you need an editor that can do it across multiple files, like Virtual Studio Code (free, cross-platform), BBEdit (Mac; I think the free version includes this feature), or Geany (free, Linux).

That would work just fine.

1 Like