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

Already encoded URLs are encoded twice #34

Closed
NicolasMassart opened this issue Dec 7, 2020 · 0 comments · Fixed by #35
Closed

Already encoded URLs are encoded twice #34

NicolasMassart opened this issue Dec 7, 2020 · 0 comments · Fixed by #35
Assignees
Labels

Comments

@NicolasMassart
Copy link
Contributor

NicolasMassart commented Dec 7, 2020

A bug introduced by #28 makes already encoded URLs encoded twice:

https://en.wikipedia.org/wiki/Glob_%28programming%29 becomes https://en.wikipedia.org/wiki/Glob_%2528programming%2529

To prevent this side effect, it's required to check if the URL is already encoded.
The simple way is to decode first. If the url is not encoded, the decoded will be the same, if it's encoded it will provide a clean version of the string.
The computation required to decode is very small and not even noticeable.

This was first reported as a markdown-link-check issue tcort/markdown-link-check#142 and it will be required to update the dependency once fixed.

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

Successfully merging a pull request may close this issue.

1 participant