Allow empty cells if not last of line.

This commit is contained in:
Tom Alexander 2023-04-20 00:15:40 -04:00
parent 49f5b65acf
commit 633d6e421f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -117,7 +117,7 @@ pub fn org_mode_table_cell<'r, 's>(
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context); let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
let (remaining, (children, _exit_contents)) = verify( let (remaining, (children, _exit_contents)) = verify(
many_till(minimal_set_object_matcher, exit_matcher), many_till(minimal_set_object_matcher, exit_matcher),
|(children, _exit_contents)| !children.is_empty(), |(children, exit_contents)| !children.is_empty() || *exit_contents == "|",
)(input)?; )(input)?;
@ -129,5 +129,5 @@ fn org_mode_table_cell_end<'r, 's>(
context: Context<'r, 's>, context: Context<'r, 's>,
input: &'s str, input: &'s str,
) -> Res<&'s str, &'s str> { ) -> Res<&'s str, &'s str> {
recognize(tuple((space0, alt((tag("|"), peek(line_ending))))))(input) recognize(tuple((space0, alt((tag("|"), line_ending)))))(input)
} }