mii-key / obsidian-links

manipulate & manage obisidian links
MIT License
105 stars 5 forks source link

Markdown links should mention file extension #26

Closed abrandst closed 6 months ago

abrandst commented 7 months ago

I believe that markdown links to other markdown files should mention the file extension. After conversion e.g [[../2022/Linux|Linux]] becomes [Linux](../2022/Linux). It reallly should be [Linux](../2022/Linux.md), mostly because when copying the generated markdown files to gitlab, the links will be broken by the missing extension.

abrandst commented 7 months ago

I investigated a bit further: When I generate markdown links using the suggester in Obsidian by disabling "Use [[Wikilinks]]" and using the autosuggester, the link generated also includes the filename. This supports the idea that this is the correct behaviour.

abrandst commented 7 months ago

Wrote a fix. Not sure if it is good, please check.

https://github.com/mii-key/obsidian-links/pull/27

mii-key commented 7 months ago

Hello,

Thanks for using the plugin and for your feedback!

Plz check Append .md extension.

Let me know if you encounter any problems.

Have a great day!

abrandst commented 7 months ago

Hi!

Looks great, works fine and I learned some new typescript tricks by looking through your commit. Thank you for the great plugin, this is so useful!

abrandst commented 7 months ago

Local links do not work properly when the feature is enabled. Testcase:

  1. Create a document like this (exclude triple backticks):
    # test
    [[#test]]
  2. Choose: Convert all links to markdown links Result:
    # test
    [#test](.md#test)
mii-key commented 7 months ago

Thank you for the detailed bug report!

Please check v. 1.10.12

Have a great day!