File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -3073,16 +3073,19 @@ where
3073
3073
text. drain ( ..end) ;
3074
3074
3075
3075
let adjust = spx. consume ( end) + 1 ;
3076
- // Do we need to account separately for the parent? I _think_ it always
3077
- // has the same start col to begin with as `sourcepos` itself.
3078
3076
assert_eq ! (
3079
3077
sourcepos. start. column,
3080
3078
parent. data. borrow( ) . sourcepos. start. column
3081
3079
) ;
3082
3080
3083
- // HACK: See tests::fuzz::echaw9. The paragraph doesn't exist in the source!
3084
- sourcepos. start . column = usize:: min ( sourcepos. end . column , adjust) ;
3085
- parent. data . borrow_mut ( ) . sourcepos . start . column = sourcepos. start . column ;
3081
+ // See tests::fuzz::echaw9. The paragraph doesn't exist in the source,
3082
+ // so we remove it.
3083
+ if sourcepos. end . column < adjust {
3084
+ parent. detach ( ) ;
3085
+ } else {
3086
+ sourcepos. start . column = adjust;
3087
+ parent. data . borrow_mut ( ) . sourcepos . start . column = adjust;
3088
+ }
3086
3089
3087
3090
grandparent. data . borrow_mut ( ) . value =
3088
3091
NodeValue :: TaskItem ( if symbol == ' ' { None } else { Some ( symbol) } ) ;
Original file line number Diff line number Diff line change @@ -350,9 +350,7 @@ fn echaw9() {
350
350
"-\t [ ]
" ,
351
351
( document ( 1 : 1 -1 : 14 ) [
352
352
( list ( 1 : 1 -1 : 14 ) [
353
- ( taskitem ( 1 : 1 -1 : 14 ) [
354
- ( paragraph ( 1 : 14 -1 : 14 ) ) // Unsatisfying. See parser::process_tasklist.
355
- ] )
353
+ ( taskitem ( 1 : 1 -1 : 14 ) )
356
354
] )
357
355
] ) ,
358
356
) ;
You can’t perform that action at this time.
0 commit comments