Skip to content

Commit 93a8e47

Browse files
committed
---
yaml --- r: 14696 b: refs/heads/try c: a9bd76b h: refs/heads/master v: v3
1 parent 739ea9f commit 93a8e47

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: e30611110a8f871bf14616f16139e1fda1817534
5+
refs/heads/try: a9bd76b3c11ee0ad706abc3779a337fee3550424
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustdoc/markdown_index_pass.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ fn pandoc_header_id(header: str) -> str {
8080
let header = maybe_use_section_id(header);
8181
ret header;
8282

83-
fn remove_formatting(s: str) -> str { s }
84-
fn remove_punctuation(s: str) -> str {
83+
fn remove_formatting(s: str) -> str {
8584
str::replace(s, "`", "")
8685
}
86+
fn remove_punctuation(s: str) -> str {
87+
let s = str::replace(s, "<", "");
88+
let s = str::replace(s, ">", "");
89+
ret s;
90+
}
8791
fn replace_with_hyphens(s: str) -> str {
8892
str::replace(s, " ", "-")
8993
}
@@ -92,6 +96,11 @@ fn pandoc_header_id(header: str) -> str {
9296
fn maybe_use_section_id(s: str) -> str { s }
9397
}
9498

99+
#[test]
100+
fn should_remove_brackets_from_headers() {
101+
assert pandoc_header_id("impl foo of bar<A>") == "impl-foo-of-bara";
102+
}
103+
95104
#[test]
96105
fn should_index_mod_contents() {
97106
let doc = test::mk_doc(

0 commit comments

Comments
 (0)