Skip to content

Commit

Permalink
Merge pull request #1698 from ehuss/fix-windows-auto-link
Browse files Browse the repository at this point in the history
Fix rule auto-linking on Windows
  • Loading branch information
traviscross authored Dec 17, 2024
2 parents d7c4bce + 8a5f94a commit 0e37f7b
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 0e37f7b

Please sign in to comment.