File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -3525,6 +3525,21 @@ fn get_methods(i: &clean::Impl) -> Vec<String> {
3525
3525
} ) . collect :: < Vec < _ > > ( )
3526
3526
}
3527
3527
3528
+ // The point is to url encode any potential character from a type with genericity.
3529
+ fn small_url_encode ( s : & str ) -> String {
3530
+ s. replace ( "<" , "%3C" )
3531
+ . replace ( ">" , "%3E" )
3532
+ . replace ( " " , "%20" )
3533
+ . replace ( "?" , "%3F" )
3534
+ . replace ( "'" , "%27" )
3535
+ . replace ( "&" , "%26" )
3536
+ . replace ( "," , "%2C" )
3537
+ . replace ( ":" , "%3A" )
3538
+ . replace ( ";" , "%3B" )
3539
+ . replace ( "[" , "%5B" )
3540
+ . replace ( "]" , "%5D" )
3541
+ }
3542
+
3528
3543
fn sidebar_assoc_items ( it : & clean:: Item ) -> String {
3529
3544
let mut out = String :: new ( ) ;
3530
3545
let c = cache ( ) ;
@@ -3568,7 +3583,8 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
3568
3583
let ret = v. iter ( )
3569
3584
. filter_map ( |i| if let Some ( ref i) = i. inner_impl ( ) . trait_ {
3570
3585
let out = format ! ( "{:#}" , i) . replace ( "<" , "<" ) . replace ( ">" , ">" ) ;
3571
- Some ( format ! ( "<a href=\" #impl-{:#}\" >{}</a>" , i, out) )
3586
+ let encoded = small_url_encode ( & format ! ( "{:#}" , i) ) ;
3587
+ Some ( format ! ( "<a href=\" #impl-{:#}\" >{}</a>" , encoded, out) )
3572
3588
} else {
3573
3589
None
3574
3590
} )
You can’t perform that action at this time.
0 commit comments