Skip to content

Commit

Permalink
Merge pull request #1593 from ehuss/rule-prefix
Browse files Browse the repository at this point in the history
Add a prefix to rule HTML IDs
  • Loading branch information
traviscross authored Aug 29, 2024
2 parents e5029a1 + 6369458 commit c118ff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mdbook-spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ impl Spec {
}
}
format!(
"<div class=\"rule\" id=\"{rule_id}\">\
<a class=\"rule-link\" href=\"#{rule_id}\">[{rule_id}]</a>\
"<div class=\"rule\" id=\"r-{rule_id}\">\
<a class=\"rule-link\" href=\"#r-{rule_id}\">[{rule_id}]</a>\
</div>\n"
)
})
Expand All @@ -104,7 +104,7 @@ impl Spec {
.iter()
.map(|(rule_id, (_, path))| {
let relative = pathdiff::diff_paths(path, current_path).unwrap();
format!("[{rule_id}]: {}#{rule_id}\n", relative.display())
format!("[{rule_id}]: {}#r-{rule_id}\n", relative.display())
})
.collect();
format!(
Expand Down

0 comments on commit c118ff6

Please sign in to comment.