From 129228c5c5d6f8b47165d3f4d33588d8aeee837f Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 21 Sep 2023 22:06:30 -0400 Subject: [PATCH] Require either eof or whitespace to line ending for valueless items. --- src/parser/plain_list.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index efabcb7..2ccacee 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -188,9 +188,9 @@ fn plain_list_item<'b, 'g, 'r, 's>( match maybe_contentless_item { Ok((_rem, _ws)) => { let (remaining, _trailing_ws) = if context.should_consume_trailing_whitespace() { - recognize(many0(blank_line))(remaining)? + recognize(alt((recognize(many1(blank_line)), eof)))(remaining)? } else { - recognize(opt(blank_line))(remaining)? + recognize(alt((blank_line, eof)))(remaining)? }; let source = get_consumed(input, remaining); return Ok((