File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -552,3 +552,43 @@ fn tasklist_symbol_sourcepos() {
552552 ]
553553 ) ;
554554}
555+
556+ #[ test]
557+ fn tasklist_symbol_sourcepos_relaxed ( ) {
558+ let mut options = Options :: default ( ) ;
559+ options. extension . tasklist = true ;
560+ options. extension . table = true ;
561+ options. parse . relaxed_tasklist_matching = true ;
562+ options. parse . tasklist_in_table = true ;
563+
564+ let arena = Arena :: new ( ) ;
565+ let md = r#"Henlo!
566+
567+ > - [あ] well
568+ >
569+ > 1. * > 3. [和] true
570+
571+ | hm | |
572+ | ---- | -- |
573+ | [ワ] | ok |
574+ "# ;
575+
576+ let root = parse_document ( & arena, md, & options) ;
577+ let sourceposes = root
578+ . descendants ( )
579+ . filter_map ( |n| {
580+ let NodeValue :: TaskItem ( ref nti) = n. data ( ) . value else {
581+ return None ;
582+ } ;
583+ Some ( nti. symbol_sourcepos )
584+ } )
585+ . collect :: < Vec < _ > > ( ) ;
586+ assert_eq ! (
587+ sourceposes,
588+ vec![
589+ ( 3 , 6 , 3 , 8 ) . into( ) ,
590+ ( 5 , 16 , 5 , 18 ) . into( ) ,
591+ ( 9 , 4 , 9 , 6 ) . into( )
592+ ]
593+ ) ;
594+ }
You can’t perform that action at this time.
0 commit comments