File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed
crates/lad_backends/mdbook_lad_preprocessor/src Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -72,21 +72,7 @@ impl ArgumentVisitor for MarkdownArgumentVisitor<'_> {
72
72
let link_display = type_identifier;
73
73
if let Some ( link_value) = link_value {
74
74
// canonicalize to linux paths
75
- let link_value = link_value
76
- . components ( )
77
- . map ( |c| match c {
78
- std:: path:: Component :: RootDir => "" . to_string ( ) ,
79
- std:: path:: Component :: CurDir => "." . to_string ( ) ,
80
- std:: path:: Component :: ParentDir => ".." . to_string ( ) ,
81
- std:: path:: Component :: Prefix ( prefix_component) => {
82
- prefix_component. as_os_str ( ) . to_string_lossy ( ) . to_string ( )
83
- }
84
- std:: path:: Component :: Normal ( os_str) => {
85
- os_str. to_string_lossy ( ) . to_string ( ) . replace ( "\\ " , "/" )
86
- }
87
- } )
88
- . collect :: < Vec < _ > > ( )
89
- . join ( "/" ) ;
75
+ let link_value = link_value. to_string_lossy ( ) . to_string ( ) . replace ( "\\ " , "/" ) ;
90
76
91
77
self . buffer . link ( link_display, link_value) ;
92
78
} else {
Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ impl IntoMarkdown for Markdown {
261
261
. replace( |c: char | !c. is_alphabetic( ) , "" )
262
262
)
263
263
} else {
264
- url. clone ( )
264
+ url. clone ( ) . replace ( " \\ " , "/" )
265
265
} ;
266
266
267
267
builder. append ( & url) ;
You can’t perform that action at this time.
0 commit comments