Do not match headlines as plain list items.
This commit is contained in:
parent
364ba79517
commit
b7442c1e92
@ -102,6 +102,22 @@ pub(crate) fn detect_not_plain_list_item_indent<'b, 'g, 'r, 's>(
|
|||||||
{
|
{
|
||||||
return Ok((input, indent));
|
return Ok((input, indent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Headlines are not plain list items.
|
||||||
|
if let Ok((_remaining, (_, indent, _))) = verify(
|
||||||
|
tuple((
|
||||||
|
start_of_line,
|
||||||
|
parser_with_context!(indentation_level)(context),
|
||||||
|
tuple((
|
||||||
|
parser_with_context!(bullet)(context),
|
||||||
|
alt((space1, line_ending, eof)),
|
||||||
|
)),
|
||||||
|
)),
|
||||||
|
|(_, (depth, bullet), (_, _))| *depth == 0 && Into::<&str>::into(bullet).starts_with('*'),
|
||||||
|
)(input)
|
||||||
|
{
|
||||||
|
return Ok((input, indent));
|
||||||
|
}
|
||||||
return Err(nom::Err::Error(CustomError::Static("No element detected.")));
|
return Err(nom::Err::Error(CustomError::Static("No element detected.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user