Skip to content

Commit c118ff6

Browse files
authored
Merge pull request #1593 from ehuss/rule-prefix
Add a prefix to rule HTML IDs
2 parents e5029a1 + 6369458 commit c118ff6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mdbook-spec/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ impl Spec {
8484
}
8585
}
8686
format!(
87-
"<div class=\"rule\" id=\"{rule_id}\">\
88-
<a class=\"rule-link\" href=\"#{rule_id}\">[{rule_id}]</a>\
87+
"<div class=\"rule\" id=\"r-{rule_id}\">\
88+
<a class=\"rule-link\" href=\"#r-{rule_id}\">[{rule_id}]</a>\
8989
</div>\n"
9090
)
9191
})
@@ -104,7 +104,7 @@ impl Spec {
104104
.iter()
105105
.map(|(rule_id, (_, path))| {
106106
let relative = pathdiff::diff_paths(path, current_path).unwrap();
107-
format!("[{rule_id}]: {}#{rule_id}\n", relative.display())
107+
format!("[{rule_id}]: {}#r-{rule_id}\n", relative.display())
108108
})
109109
.collect();
110110
format!(

0 commit comments

Comments
 (0)