mirror of https://github.com/rust-lang/rust.git
rustdoc: Filter out another invalid id character
This commit is contained in:
parent
2d1ca984eb
commit
6161429363
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue