File tree Expand file tree Collapse file tree
crates/mdbook-html/src/html_handlebars Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,19 +161,23 @@ impl StaticFiles {
161161
162162 this. static_files . push ( StaticFile :: Additional {
163163 input_location,
164+ // Always use forward slashes for consistent hash_map keys across platforms.
164165 filename : custom_file
165166 . to_str ( )
166167 . with_context ( || "resource file names must be valid utf8" ) ?
167- . to_owned ( ) ,
168+ . replace ( '\\' , "/" ) ,
168169 } ) ;
169170 }
170171
171172 for input_location in theme. font_files . iter ( ) . cloned ( ) {
172- let filename = Path :: new ( "fonts" )
173- . join ( input_location. file_name ( ) . unwrap ( ) )
174- . to_str ( )
175- . with_context ( || "resource file names must be valid utf8" ) ?
176- . to_owned ( ) ;
173+ let filename = format ! (
174+ "fonts/{}" ,
175+ input_location
176+ . file_name( )
177+ . unwrap( )
178+ . to_str( )
179+ . with_context( || "resource file names must be valid utf8" ) ?
180+ ) ;
177181 this. static_files . push ( StaticFile :: Additional {
178182 input_location,
179183 filename,
You can’t perform that action at this time.
0 commit comments