File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed 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