[Bug] generateMarkdownLink behaves unexpectedly for markdown links (i.e. non-wikilinks) to heading/block

Another issue reported regarding generateMarkdownLink: