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 @@ -482,7 +482,9 @@ impl ItemizedBlock {
482
482
// allowed.
483
483
for suffix in [ ". " , ") " ] {
484
484
if let Some ( ( prefix, _) ) = trimmed. split_once ( suffix) {
485
- if prefix. len ( ) <= 2 && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) ) {
485
+ if ( 1 ..=2 ) . contains ( & prefix. len ( ) )
486
+ && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) )
487
+ {
486
488
return Some ( prefix. len ( ) + suffix. len ( ) ) ;
487
489
}
488
490
}
@@ -2126,6 +2128,9 @@ fn main() {
2126
2128
// https://spec.commonmark.org/0.30 says: "A start number may not be negative":
2127
2129
"-1. Not a list item." ,
2128
2130
"-1 Not a list item." ,
2131
+ // Marker without prefix are not recognized as item markers:
2132
+ ". Not a list item." ,
2133
+ ") Not a list item." ,
2129
2134
] ;
2130
2135
for line in test_inputs. iter ( ) {
2131
2136
let maybe_block = ItemizedBlock :: new ( line) ;
You can’t perform that action at this time.
0 commit comments