File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 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> {
35253525 } ) . collect :: < Vec < _ > > ( )
35263526}
35273527
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+
35283543fn sidebar_assoc_items ( it : & clean:: Item ) -> String {
35293544 let mut out = String :: new ( ) ;
35303545 let c = cache ( ) ;
@@ -3568,7 +3583,8 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
35683583 let ret = v. iter ( )
35693584 . filter_map ( |i| if let Some ( ref i) = i. inner_impl ( ) . trait_ {
35703585 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) )
35723588 } else {
35733589 None
35743590 } )
You can’t perform that action at this time.
0 commit comments