Open RyotaUshio opened 5 months ago
Now I read the source code from the dev tool, and it seems like it's intended.
I guess this design is because generateMarkdownLink
generates an embed link for attachment files and display text is not important for embeds.
However, generateMarkdownLink
is also used to generate a non-embed link like so:
app.fileManager.generateMarkdownLink(...).slice(1)
I do this for generating links for PDF files, and even Obsidian itself does the same thing in many places.
So I believe it will be beneficial to let alias
work for attachments as well. If you choose not to do so, it should be clarified in the documentation.
For example, if I turn on "Use [[Wikilinks]]" and copy a link to a PDF annotation, this becomes problematic:
https://github.com/obsidianmd/obsidian-api/assets/72342591/736b51c0-8919-43f0-a17d-59d2a28f54dd
Steps to reproduce:
file.png
.Expected result:
![Display text](file.png)
Actual result:
![](file.png)
The
alias
parameter has no effect.