Skip to content

Commit

Permalink
Fix rule auto-linking on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Dec 17, 2024
1 parent d7c4bce commit 8a5f94a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mdbook-spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ impl Spec {
.iter()
.map(|(rule_id, (_, path))| {
let relative = pathdiff::diff_paths(path, current_path).unwrap();
format!("[{rule_id}]: {}#r-{rule_id}\n", relative.display())
// Adjust paths for Windows.
let relative = relative.display().to_string().replace('\\', "/");
format!("[{rule_id}]: {}#r-{rule_id}\n", relative)
})
.collect();
format!(
Expand Down

0 comments on commit 8a5f94a

Please sign in to comment.