@@ -204,6 +204,9 @@ let rec inline_element :
204
204
| `Plus ->
205
205
junk input;
206
206
Loc. at location (`Word " +" )
207
+ | `Bar ->
208
+ junk input;
209
+ Loc. at location (`Word " |" )
207
210
| (`Code_span _ | `Math_span _ | `Raw_markup _ ) as token ->
208
211
junk input;
209
212
Loc. at location token
@@ -364,6 +367,11 @@ and delimited_inline_element_list :
364
367
junk input;
365
368
let element = Loc. same next_token (`Space ws) in
366
369
consume_elements ~at_start_of_line: true (element :: acc)
370
+ | `Bar as token ->
371
+ let acc =
372
+ inline_element input next_token.location ~context token :: acc
373
+ in
374
+ consume_elements ~at_start_of_line: false acc
367
375
| (`Minus | `Plus ) as bullet ->
368
376
(if at_start_of_line then
369
377
let suggestion =
@@ -457,8 +465,8 @@ let paragraph : input -> Ast.nestable_block_element with_location =
457
465
fun acc ->
458
466
let next_token = peek input in
459
467
match next_token.value with
460
- | (`Space _ | `Minus | `Plus | #token_that_always_begins_an_inline_element )
461
- as token ->
468
+ | ( `Space _ | `Minus | `Plus | `Bar
469
+ | #token_that_always_begins_an_inline_element ) as token ->
462
470
let element =
463
471
inline_element input next_token.location ~context: Outside_light_table
464
472
token
@@ -748,19 +756,6 @@ let rec block_element_list :
748
756
|> add_warning input;
749
757
junk input;
750
758
consume_block_elements ~parsed_a_tag where_in_line acc
751
- (* Bars can never appear directly in block content.
752
- They can only appear inside [{t ...}]. *)
753
- | { value = `Bar as token ; location } ->
754
- let suggestion =
755
- Printf. sprintf " move %s into %s." (Token. print token)
756
- (Token. describe `Begin_table_light )
757
- in
758
- Parse_error. not_allowed ~what: (Token. describe token)
759
- ~in_what: (Token. describe parent_markup)
760
- ~suggestion location
761
- |> add_warning input;
762
- junk input;
763
- consume_block_elements ~parsed_a_tag where_in_line acc
764
759
(* Tags. These can appear at the top level only. Also, once one tag is seen,
765
760
the only top-level elements allowed are more tags. *)
766
761
| { value = `Tag tag as token ; location } as next_token -> (
@@ -872,8 +867,8 @@ let rec block_element_list :
872
867
let tag = Loc. at location (`Tag tag) in
873
868
consume_block_elements ~parsed_a_tag: true `After_text
874
869
(tag :: acc)))
875
- | { value = #token_that_always_begins_an_inline_element ; _ } as next_token
876
- ->
870
+ | ( { value = #token_that_always_begins_an_inline_element ; _ }
871
+ | { value = `Bar ; _ } ) as next_token ->
877
872
warn_if_after_tags next_token;
878
873
warn_if_after_text next_token;
879
874
0 commit comments