Support blank lines for descriptive list with empty value before final list item.

This commit is contained in:
Tom Alexander
2023-09-21 22:03:21 -04:00
parent dc5695ec9f
commit f0a7493a89
3 changed files with 12 additions and 6 deletions

View File

@@ -187,7 +187,11 @@ fn plain_list_item<'b, 'g, 'r, 's>(
)(&parser_context))(remaining);
match maybe_contentless_item {
Ok((_rem, _ws)) => {
let (remaining, _trailing_ws) = opt(blank_line)(remaining)?;
let (remaining, _trailing_ws) = if context.should_consume_trailing_whitespace() {
recognize(many0(blank_line))(remaining)?
} else {
recognize(opt(blank_line))(remaining)?
};
let source = get_consumed(input, remaining);
return Ok((
remaining,
@@ -245,6 +249,7 @@ fn plain_list_item<'b, 'g, 'r, 's>(
));
}
#[derive(Debug)]
enum BulletType {
Ordered,
Unordered,