-
Notifications
You must be signed in to change notification settings - Fork 13.7k
fix partial urlencoded link support #146195
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs - added tests urlecoding provided by https://crates.io/crates/urlencoding
33b4231
to
89ee760
Compare
This comment has been minimized.
This comment has been minimized.
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
Let me know if you need help with the errors. |
The error is about the Cargo.lock
So, I tried committing the cargo.lock file of the linkchecker package as well, but the problem persisted. So, do I need to update the Cargo.lock file at the root of the repo? |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
Hello Rust community.
This is my first contribution, hope is useful.
While translating in Italian the rust book https://github.com/nixxo/rust-lang-book-it I noticed that the linkchecker tool was failing reporting broken links on some pages even if the link worked properly in the browser. Upon inspection I noticed that mdbook basically urlencoded the links, but not urlencoded the heading IDs resulting in a non-identical anchor/IDs pairing that linkchecker reports as non-valid.
looking at the source code for the linkchecker tool I noticed that urlencoding was done by the
small_url_encode
function in a partial way, as the name suggests. Replacing this function with a full urlencoding fixes the issue and the links are properly reported as valid.urlecoding provided by https://crates.io/crates/urlencoding