obsidian-link-with-alias
obsidian-link-with-alias copied to clipboard
[BUG] Link with Alias fails to create defined alias when there are punctuation marks following.
Link with Alias fails to create defined alias when there are punctuation marks following.
For example, quite commonly, but not 100% consistently I may type +some topic, select that, and add the alias like +some topic|some topic and execute the create link with alias command. Often, when there is puncuatation following like +some topic|some topic, -- even though the comma is NOT selected -- the alias created is +some topic. I then have to manually edit the note and its alias. And then I return to the note where the reference was created, I have to manually edit [[+some topic|+some topic]] into [[+some topic|some topic]].
I never tried to add alias before the create link with alias command is executed, like you do.
Yes there is a bug in this plugin and it behaves strange when you select text like link|alias and then you execute create link with alias command.
Workaround
Use the plugin as expected. It means first write down the text of alias, then run the command create link with alias and then edit the link in order to select the expected link target. That use case is tested and should work for you.
@stoweboyd Does the workaround works for you?
Now you can select link|text and run Create link with alias command and it correctly creates [[link|text]].
If there is more then one "|", then nothing command does nothing.
Doesn't work. I created +concept|concept, selected it, and ran create link with alias. I got [[+concept|concept|+concept|+concept|concept]].
@stoweboyd I cannot reproduce it now with 1.0.9. Please check that you really updated to the plugin. There was a problem with release of 1.0.9 so obsidian did not wanted to update to this version. It should be fixed now.