Skip to content

Commit a6a7b4d

Browse files
committed
fix test
1 parent a80dc49 commit a6a7b4d

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

crates/lad_backends/mdbook_lad_preprocessor/src/argument_visitor.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,7 @@ impl ArgumentVisitor for MarkdownArgumentVisitor<'_> {
7272
let link_display = type_identifier;
7373
if let Some(link_value) = link_value {
7474
// 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("\\", "/");
9076

9177
self.buffer.link(link_display, link_value);
9278
} else {

crates/lad_backends/mdbook_lad_preprocessor/src/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl IntoMarkdown for Markdown {
261261
.replace(|c: char| !c.is_alphabetic(), "")
262262
)
263263
} else {
264-
url.clone()
264+
url.clone().replace("\\", "/")
265265
};
266266

267267
builder.append(&url);

0 commit comments

Comments
 (0)