File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ impl ItemizedBlock {
473
473
/// 1868. He wes buried in...
474
474
/// ```
475
475
fn get_marker_length ( trimmed : & str ) -> Option < usize > {
476
+ tracing:: debug!( "get_marker_length: {}" , trimmed) ;
476
477
// https://spec.commonmark.org/0.30/#bullet-list-marker or
477
478
// https://spec.commonmark.org/0.30/#block-quote-marker
478
479
let itemized_start = [ "* " , "- " , "> " , "+ " ] ;
@@ -484,7 +485,9 @@ impl ItemizedBlock {
484
485
// allowed.
485
486
for suffix in [ ". " , ") " ] {
486
487
if let Some ( ( prefix, _) ) = trimmed. split_once ( suffix) {
487
- if prefix. len ( ) <= 2 && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) ) {
488
+ if ( 1 ..=2 ) . contains ( & prefix. len ( ) )
489
+ && prefix. chars ( ) . all ( |c| char:: is_ascii_digit ( & c) )
490
+ {
488
491
return Some ( prefix. len ( ) + suffix. len ( ) ) ;
489
492
}
490
493
}
@@ -2142,6 +2145,9 @@ fn main() {
2142
2145
// https://spec.commonmark.org/0.30 says: "A start number may not be negative":
2143
2146
"-1. Not a list item." ,
2144
2147
"-1 Not a list item." ,
2148
+ // Marker without prefix are not recognized as item markers:
2149
+ ". Not a list item." ,
2150
+ ") Not a list item." ,
2145
2151
] ;
2146
2152
for line in test_inputs. iter ( ) {
2147
2153
let maybe_block = ItemizedBlock :: new ( line) ;
You can’t perform that action at this time.
0 commit comments