Skip to content

Commit 8a5f94a

Browse files
committed
Fix rule auto-linking on Windows
1 parent d7c4bce commit 8a5f94a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mdbook-spec/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ impl Spec {
9898
.iter()
9999
.map(|(rule_id, (_, path))| {
100100
let relative = pathdiff::diff_paths(path, current_path).unwrap();
101-
format!("[{rule_id}]: {}#r-{rule_id}\n", relative.display())
101+
// Adjust paths for Windows.
102+
let relative = relative.display().to_string().replace('\\', "/");
103+
format!("[{rule_id}]: {}#r-{rule_id}\n", relative)
102104
})
103105
.collect();
104106
format!(

0 commit comments

Comments
 (0)