rustdoc: Filter out another invalid id character

This commit is contained in:
Brian Anderson 2012-07-09 15:13:22 -07:00
parent 2d1ca984eb
commit 6161429363
1 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,7 @@ fn pandoc_header_id(header: str) -> str {
let s = str::replace(s, "/", "");
let s = str::replace(s, ":", "");
let s = str::replace(s, "&", "");
let s = str::replace(s, "^", "");
ret s;
}
fn replace_with_hyphens(s: str) -> str {
@ -139,6 +140,8 @@ fn should_remove_punctuation_from_headers() {
== "impl-of-numnum-for-int";
assert pandoc_header_id("impl of num::num for int/&")
== "impl-of-numnum-for-int";
assert pandoc_header_id("impl of num::num for ^int")
== "impl-of-numnum-for-int";
}
#[test]