[rustdoc] Wrong URL encoding for % sign #112580
Labels
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
The source code in the Rust Documentation can be executed using the Rust Playground by pressing the "Run" button, but the URL encoding of the
%
symbol used is incorrect and will not execute correctly.The
%
is encoded as%%
, but the correct encoding is%25
.For example, Vec retain has source code containing
%
.https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.retain
This "Run" is linked to the following
https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0Alet+mut+vec+=+vec!%5B1,+2,+3,+4%5D;%0Avec.retain(%7C%26x%7C+x+%%+2+==+0);%0Aassert_eq!(vec,+%5B2,+4%5D);%0A%7D&edition=2021
However, this does not work correctly. The correct way is as follows.
https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0Alet+mut+vec+=+vec!%5B1,+2,+3,+4%5D;%0Avec.retain(%7C%26x%7C+x+%25+2+==+0);%0Aassert_eq!(vec,+%5B2,+4%5D);%0A%7D&edition=2021
The text was updated successfully, but these errors were encountered: