File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ fn pandoc_header_id(header: str) -> str {
86
86
fn remove_punctuation ( s : str ) -> str {
87
87
let s = str:: replace ( s, "<" , "" ) ;
88
88
let s = str:: replace ( s, ">" , "" ) ;
89
+ let s = str:: replace ( s, "[" , "" ) ;
90
+ let s = str:: replace ( s, "]" , "" ) ;
91
+ let s = str:: replace ( s, "(" , "" ) ;
92
+ let s = str:: replace ( s, ")" , "" ) ;
93
+ let s = str:: replace ( s, "@" , "" ) ;
94
+ let s = str:: replace ( s, "~" , "" ) ;
89
95
ret s;
90
96
}
91
97
fn replace_with_hyphens ( s : str ) -> str {
@@ -97,8 +103,9 @@ fn pandoc_header_id(header: str) -> str {
97
103
}
98
104
99
105
#[ test]
100
- fn should_remove_brackets_from_headers ( ) {
106
+ fn should_remove_punctuation_from_headers ( ) {
101
107
assert pandoc_header_id ( "impl foo of bar<A>" ) == "impl-foo-of-bara" ;
108
+ assert pandoc_header_id ( "fn@([~A])" ) == "fna" ;
102
109
}
103
110
104
111
#[ test]
You can’t perform that action at this time.
0 commit comments