Bulk unlinked references button/option

Bulk linking multiple unlinked references

When going through unlinked references it is often that I am pushing links multiple times one after the other, or going through the search wanting to highlight and bulk link multiple results.

2 Likes

Good idea!

As a possible workaround, if you don’t mind jumping into VSCode, you could do a vault wide search and replace, searching for all occurrences of the note name test link that are not immediately followed by two closing brackets and replacing them with [[test link]]. I am no expert at this by any means, but I think you might be able to do this by enabling regex for the Edit>Replace in all files command, and searching for test link(?!\]\]) and replacing it with [[test link]]

Unfortunately lookbehinds don’t work in VSCode regex as far as I know. Anyways, of course you will want to review the occurrences before committing, and make sure you have a backup ahead of time. If you use | characters to get alternate display of links, the regex lookahead could be adapted to pick that up as well as well as using capture groups. Although I can get an expression to work, I am not feeling confident enough with it to post it just yet. I definitely don’t want to imply this is a very elegant or trusty workaround. But, in certain scenarios, it may do the trick.

Good luck!

Edit: I realize now that it could get some false positives when test link is using | afterwards or if the words test link occur within a larger link name. So, either the regex could be further fine tuned or you could rely on reviewing the occurrences before committing the search and replace.

1 Like