Make unlinked mentions clickable in the editor

Problem

The “outgoing links” core plugin automatically detects unlinked mentions of other pages on the current page. However it requires you to manually choose to convert those mentions into [[wikilinks]].

Proposed solution

Given we already know what unlinked mentions we have, we should be able to show them as clickable links in the editor, treating them as though they are wikilinks without modifying the markdown.

Benefits of this feature

  • There’d be less manual effort involved in linking between pages.
  • We’d be reminded of the pages we already have as we type, in a way that is more noticeable than having them show up in a side panel.
  • Link density would be higher, improving the discoverability and utility of our notes.
  • Since we would not be automatically inserting wikilinks, the functionality is non-invasive/reversible, and false positive links would not cause lasting harm.

Potential shortcomings of this feature

  • There would be false positives. Unlinked mentions in the outgoing links plugin already contain false positives, but it might be more annoying to have them in the editor.
    • Nico Nico Pedia (sample page) has an implementation of this proposal. Apologies for it being in Japanese (I’m not aware of any English implementations). If you translate the page using your browser’s translation feature, you can get a sense of the false positives they have.
  • The links would not work outside Obsidian, since they’re not marked in the underlying markdown in any way.
  • There would be collisions (a partial or full overlap in page names leading to multiple possible link destinations). We could take a greedy, best-effort approach here, and the user can explicitly use a wikilink if they want to specify which page to link to.
  • If we make these links show up in the graph view there would be false positives, and if we don’t then the graph view would be less useful than when the user is manually inserting links.
  • The user would have less control over when not to link.

Related feature requests

Related scripts


Please let me know if this can be done through a plugin (Is it possible for a plugin to manipulate the editor DOM?) – thanks!

1 Like

Another potential shortcoming might be performance. I think the unlinked mentions feature essentially performs a search each time you use it. Altho this would be more like running Quick Open on every single word and consecutive combination of words in the note.

Alternate proposals:

  • Run link autosuggestion on all typing.
  • If text is selected when Quick Open is run, pre-fill it with the selected text like in-page search does (this won’t remind you of existing pages as you type, tho).

I personally wouldn’t want the original proposed feature (or autosuggestion on all typing), but I can see how someone might.

1 Like

Use case or problem

TheBrain—an app I know the team have used in the past—contains a useful feature that would be amazing to see ported across to Obsidian if technically feasible.

When typing in TheBrain’s editor, if it identifies a note that’s already created with the same name, it’ll underline it for you as a prompt to link to it. You can then view or link to the note via a right click menu.

This feature would be an addition to or an improvement on the ‘unlinked mentions’ section which you’d need to periodically check yourself for new links. The extra prompt within the editor would be a fantastic user experience improvement in promoting the action of linking thoughts together.

As always, thanks team!

Proposed solution

See above

Current workaround (optional)

No current workaround

1 Like

There’s already a recent (less well-formatted) request for this:

https://forum.obsidian.md/t/unlinked-mentions-visible-in-editor-pane/50423

EDIT: Actually it was later, and is now merged into this thread.

Various Complements plugin runs link autosuggestion on all typing btw. So damn useful.

1 Like

I’ve switched over from TheBrain to Obsidian in January 2024.

I’d appreciate such a solution much. It really helps to become more aware of the material you already have and make more links, in the app, but also in your mind.

Thanks to the team.

Welcome! You won’t regret the switch (I didn’t) :smile:

I use links with aliases quite a bit in my notes. Sometimes I remember them, sometimes not. So I often go through the outlinks panel to discover and add unlinked mentions. This is great, but it’s also tedious.

Maybe this is the sort of thing for a plug-in could do, but I would love if Obsidian could have a built-in way to display unlinked mentions directly in the editor, perhaps with a squiggly line under the text and/or a highlight color and an button or right-click menu option to link. Something like a spellchecker for unmentioned links.

3 Likes

Great idea! Maybe a dashed or dotted line, without changing the color until it becomes a real link: