oprypin / mkdocs-literate-nav

MkDocs plugin to specify the navigation in Markdown instead of YAML
https://oprypin.github.io/mkdocs-literate-nav
MIT License
73 stars 8 forks source link

Fix: always remove URL quotation from non http links. #10

Open mkusz opened 2 years ago

mkusz commented 2 years ago

Obsidian.md creates links to other markdown files by using URL quotation so instead [Link to a file](link to a file.md) we will see [Link to a file](link%20to%20a%20file.md). If we remove URL quotation manually from a link, then Obsidian.md is not able to support this link and basic functionalities like link jumping and graph display are not working. Since MkDocs can be used as a presentation layer, then a valid place to remove URL quotations is to do it just before parsing markdown files and producing static documentation.

oprypin commented 2 years ago

I don't understand, why wouldn't we simply always unquote the links? Are there any downsides? Or, can't the current behavior be considered buggy?

mkusz commented 2 years ago

@oprypin I have checked the behavior of MkDocs itself and the encoded links are always unquoted/decoded. I will remove flag from the code and simplify the number of changes, so we will have a common behavior with MkDocs parser.

mkusz commented 2 years ago

I have reverted most changes and just add one that is doing unquoting on nav elements that are non valid http links.