Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mkusz
Copy link

@mkusz mkusz commented Jan 10, 2022

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.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@oprypin
Copy link
Owner

oprypin commented Jan 10, 2022

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
Copy link
Author

mkusz commented Jan 10, 2022

@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 mkusz changed the title Support for url quoted file name links produced by Obsidian.md Fix: always remove URL quotation from non http links. Jan 11, 2022
@mkusz
Copy link
Author

mkusz commented Jan 11, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants