-
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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. |
@ehuss Ups, sorry. I noticed that after the committed fixes I didn't message you. |
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs - added tests urlecoding provided by https://crates.io/crates/urlencoding
881d956
to
8b58777
Compare
Thanks! I squashed the commits just to keep the history a little cleaner. @bors r+ rollup |
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
Rollup of 11 pull requests Successful merges: - #145177 (std: move `thread` into `sys`) - #146018 (compiler: Add Windows resources to rustc-main and rustc_driver) - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`) - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit) - #146195 (fix partial urlencoded link support) - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.) - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`) - #146324 (const-eval: disable pointer fragment support) - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.)) - #146339 (Update books) - #146343 (Weakly export `platform_version` symbols) r? `@ghost` `@rustbot` modify labels: rollup
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
Rollup of 11 pull requests Successful merges: - #139593 (add sitemap to rust docs) - #145819 (Port limit attributes to the new attribute parsing infrastructure) - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`) - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit) - #146195 (fix partial urlencoded link support) - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.) - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`) - #146324 (const-eval: disable pointer fragment support) - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.)) - #146339 (Update books) - #146343 (Weakly export `platform_version` symbols) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - #139593 (add sitemap to rust docs) - #145819 (Port limit attributes to the new attribute parsing infrastructure) - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`) - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit) - #146195 (fix partial urlencoded link support) - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.) - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`) - #146324 (const-eval: disable pointer fragment support) - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.)) - #146339 (Update books) - #146343 (Weakly export `platform_version` symbols) r? `@ghost` `@rustbot` modify labels: rollup
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
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