File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: e30611110a8f871bf14616f16139e1fda1817534
5
+ refs/heads/try: a9bd76b3c11ee0ad706abc3779a337fee3550424
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -80,10 +80,14 @@ fn pandoc_header_id(header: str) -> str {
80
80
let header = maybe_use_section_id ( header) ;
81
81
ret header;
82
82
83
- fn remove_formatting ( s : str ) -> str { s }
84
- fn remove_punctuation ( s : str ) -> str {
83
+ fn remove_formatting ( s : str ) -> str {
85
84
str:: replace ( s, "`" , "" )
86
85
}
86
+ fn remove_punctuation ( s : str ) -> str {
87
+ let s = str:: replace ( s, "<" , "" ) ;
88
+ let s = str:: replace ( s, ">" , "" ) ;
89
+ ret s;
90
+ }
87
91
fn replace_with_hyphens ( s : str ) -> str {
88
92
str:: replace ( s, " " , "-" )
89
93
}
@@ -92,6 +96,11 @@ fn pandoc_header_id(header: str) -> str {
92
96
fn maybe_use_section_id ( s : str ) -> str { s }
93
97
}
94
98
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
+
95
104
#[ test]
96
105
fn should_index_mod_contents ( ) {
97
106
let doc = test:: mk_doc (
You can’t perform that action at this time.
0 commit comments