about summary refs log tree commit diff
path: root/Cargo.lock
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-09 14:35:03 +1000
committerGitHub <noreply@github.com>2025-09-09 14:35:03 +1000
commit3bd603b2394a7d98426ec9263eae08a418544e92 (patch)
tree63ffd19e1192a7182af8ef0f28f3eccc4fb29e71 /Cargo.lock
parentc5a62b80587ef3c48245990ad5cd8f02518b2565 (diff)
parent8b58777968a4c663d6c1293bacff6da99e6e5203 (diff)
downloadrust-3bd603b2394a7d98426ec9263eae08a418544e92.tar.gz
rust-3bd603b2394a7d98426ec9263eae08a418544e92.zip
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
Diffstat (limited to 'Cargo.lock')
-rw-r--r--Cargo.lock7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2053ad81441..44b8f1a1642 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2167,6 +2167,7 @@ version = "0.1.0"
 dependencies = [
  "html5ever",
  "regex",
+ "urlencoding",
 ]
 
 [[package]]
@@ -5825,6 +5826,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "urlencoding"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
+
+[[package]]
 name = "utf-8"
 version = "0.7.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"