mkdocs-literate-nav icon indicating copy to clipboard operation
mkdocs-literate-nav copied to clipboard

Fix: always remove URL quotation from non http links.

Open mkusz opened this issue 3 years ago • 3 comments

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.

mkusz avatar Jan 10 '22 22:01 mkusz

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?

oprypin avatar Jan 10 '22 22:01 oprypin

@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 avatar Jan 10 '22 23:01 mkusz

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

mkusz avatar Jan 11 '22 00:01 mkusz