You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #146195 - nixxo:urlencoding-fix, r=ehuss
fix partial urlencoded link support
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.
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs
- added tests
urlecoding provided by https://crates.io/crates/urlencoding
0 commit comments