File tree Expand file tree Collapse file tree 2 files changed +135
-99
lines changed Expand file tree Collapse file tree 2 files changed +135
-99
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ static REGEX_IGNORE: LazyLock<Regex> =
2727static REGEX_IGNORE_END : LazyLock < Regex > = LazyLock :: new ( || Regex :: new ( r"(\.|\?|;|!)$" ) . unwrap ( ) ) ;
2828static REGEX_IGNORE_LINK_TARGETS : LazyLock < Regex > =
2929 LazyLock :: new ( || Regex :: new ( r"^\[.+\]: " ) . unwrap ( ) ) ;
30- static REGEX_SPLIT : LazyLock < Regex > = LazyLock :: new ( || Regex :: new ( r"(\.|\?|;|!)\s+" ) . unwrap ( ) ) ;
30+ static REGEX_SPLIT : LazyLock < Regex > = LazyLock :: new ( || Regex :: new ( r"(\.|[^r] \?|;|!)\s+" ) . unwrap ( ) ) ;
3131
3232fn main ( ) -> Result < ( ) > {
3333 let cli = Cli :: parse ( ) ;
@@ -92,7 +92,7 @@ fn display(header: &str, paths: &[PathBuf]) {
9292
9393fn ignore ( line : & str , in_code_block : bool ) -> bool {
9494 in_code_block
95- || line. contains ( "e.g." )
95+ || line. to_lowercase ( ) . contains ( "e.g." )
9696 || line. contains ( "i.e." )
9797 || line. contains ( '|' )
9898 || line. trim_start ( ) . starts_with ( '>' )
@@ -174,7 +174,9 @@ fn test_sembr() {
174174must! be; split? and. normalizes space
1751751. ignore numbered
176176ignore | tables
177- ignore e.g. and i.e.
177+ ignore e.g. and
178+ ignore i.e. and
179+ ignore E.g. too
178180- ignore. list
179181* ignore. list
180182```
191193normalizes space
1921941. ignore numbered
193195ignore | tables
194- ignore e.g. and i.e.
196+ ignore e.g. and
197+ ignore i.e. and
198+ ignore E.g. too
195199- ignore. list
196200* ignore. list
197201```
@@ -269,3 +273,19 @@ hi again.
269273 let processed = lengthen_lines ( & processed, 50 ) ;
270274 assert_eq ! ( expected, processed) ;
271275}
276+
277+ #[ test]
278+ fn test_sembr_question_mark ( ) {
279+ let original = "\
280+ o? whatever
281+ r? @reviewer
282+ r? @reviewer
283+ " ;
284+ let expected = "\
285+ o?
286+ whatever
287+ r? @reviewer
288+ r? @reviewer
289+ " ;
290+ assert_eq ! ( expected, comply( original) ) ;
291+ }
You can’t perform that action at this time.
0 commit comments