Skip to content

Commit 0e37f7b

Browse files
authored
Merge pull request #1698 from ehuss/fix-windows-auto-link
Fix rule auto-linking on Windows
2 parents d7c4bce + 8a5f94a commit 0e37f7b

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)