… if the alias is already present in YAML/Properties of the file I’m trying to link to.
Apparently, if the alias I want to use to display the wikilink I’m creating to a file’s heading already exists in the YAML/Properties of said file, the wikilink auto-complete completely overwrite the currently selected heading and replace it by the alias instead of simply appending the alias after the heading in the wikilink.
It works as expected if I use a “brand new” alias (i.e.: an alias not added to the list of aliases in the other file as there’s no match found
per the auto-complete)
(Sorry, it’s not easy to explain )
Steps to reproduce
- Create a brand new note in the Sandbox vault
- Add one or more aliases to a note in the Sandbox vault (e.g.: the aliases
test
,an alias
,another test
inStart Here.md
)
→ Screenshot of Start Here.md
in Live Preview
→ YAML
of Start Here.md
in Source Mode
---
aliases:
- test
- an alias
- another test
---
-
In the new note, try to create a link to the first heading in
Start here.md
(which would be theH2
titled asI’m interested in Obsidian
) while wanting to display that link using the aliastest
→
[[Start Here#I’m interested in Obsidian|test]]
(See down below for the results I get)
Did you follow the troubleshooting guide? [Y/N]
Yes, this was tested in the Sandbox vault.
Expected result
The wikilink auto-complete shouldn’t replace the heading I selected by the alias but it should append it .
Actual result
After selecting the heading in the suggestions made by the auto-complete and inserting it in the wikilink using ⇥ Tab , I add a pipe (|
) and try to select the alias I want to add to the wikilink (using once again ⇥ Tab ) … But, the previously selected heading is entirely replaced by the alias… which shouldn’t happen.
At least, I don’t really remember having such issues while trying to create a link such as : [[File Name#Heading|Alias]]
before… but I could be wrong .
On the other hand, if nothing can be selected as an alias in the auto-complete (the alias is not in the list of aliases and the auto-complete states no match found
), it works as expected …
E.g.: creating a link to [[Start Here#I’m interested in Obsidian|Something]]
where the alias “Something” is not in the list of aliases in the YAML/Properties of Start Here.md
.
Environment
MacOS: Big Sur 11.7.9
SYSTEM INFO:
Obsidian version: v1.4.2
Installer version: v1.3.7
Operating system: Darwin Kernel Version 20.6.0: Thu Jul 6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64 20.6.0
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0
RECOMMENDATIONS:
none
Additional information
Fortunately, there’s a workaround to this .
When wanting to create a wikilink to a specific heading while displaying an alias (if the alias is already in the aliases
key in YAML/Properties) one can add the desired alias first and then get back just before the pipe (|
) to finally add the heading through the auto-complete but that’s quite unintuitive and not very practical as such links are written as [[File Name#Heading|Alias]]
.
At least, when it comes to create such link into a note.