File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -484,7 +484,9 @@ impl ItemizedBlock {
484
484
// allowed.
485
485
for suffix in [ ". " , ") " ] {
486
486
if let Some ( ( prefix, _) ) = trimmed. split_once ( suffix) {
487
- if prefix. len ( ) <= 2 && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) ) {
487
+ if ( 1 ..=2 ) . contains ( & prefix. len ( ) )
488
+ && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) )
489
+ {
488
490
return Some ( prefix. len ( ) + suffix. len ( ) ) ;
489
491
}
490
492
}
@@ -2142,6 +2144,9 @@ fn main() {
2142
2144
// https://spec.commonmark.org/0.30 says: "A start number may not be negative":
2143
2145
"-1. Not a list item." ,
2144
2146
"-1 Not a list item." ,
2147
+ // Marker without prefix are not recognized as item markers:
2148
+ ". Not a list item." ,
2149
+ ") Not a list item." ,
2145
2150
] ;
2146
2151
for line in test_inputs. iter ( ) {
2147
2152
let maybe_block = ItemizedBlock :: new ( line) ;
You can’t perform that action at this time.
0 commit comments