The current problem is plain_list_item_end is not taking into account depth.
This commit is contained in:
parent
68156f3667
commit
2b0e88dc01
@ -1,6 +1,7 @@
|
|||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::character::complete::line_ending;
|
use nom::character::complete::line_ending;
|
||||||
use nom::combinator::eof;
|
use nom::combinator::eof;
|
||||||
|
use nom::combinator::peek;
|
||||||
use nom::combinator::recognize;
|
use nom::combinator::recognize;
|
||||||
use nom::combinator::verify;
|
use nom::combinator::verify;
|
||||||
use nom::multi::many1;
|
use nom::multi::many1;
|
||||||
@ -32,7 +33,10 @@ pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s st
|
|||||||
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(standard_set_object_matcher, exit_matcher),
|
many_till(
|
||||||
|
standard_set_object_matcher,
|
||||||
|
peek(alt((eof, recognize(tuple((line_ending, exit_matcher)))))),
|
||||||
|
),
|
||||||
|(children, _exit_contents)| !children.is_empty(),
|
|(children, _exit_contents)| !children.is_empty(),
|
||||||
)(input)?;
|
)(input)?;
|
||||||
|
|
||||||
@ -46,8 +50,8 @@ pub fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s st
|
|||||||
fn paragraph_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
fn paragraph_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
|
||||||
let non_paragraph_element_matcher = parser_with_context!(non_paragraph_element)(context);
|
let non_paragraph_element_matcher = parser_with_context!(non_paragraph_element)(context);
|
||||||
alt((
|
alt((
|
||||||
recognize(tuple((line_ending, many1(blank_line)))),
|
recognize(many1(blank_line)),
|
||||||
recognize(tuple((line_ending, non_paragraph_element_matcher))),
|
recognize(non_paragraph_element_matcher),
|
||||||
eof,
|
eof,
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,8 @@ fn plain_list_item_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<
|
|||||||
let plain_list_item_matcher = parser_with_context!(plain_list_item)(context);
|
let plain_list_item_matcher = parser_with_context!(plain_list_item)(context);
|
||||||
let line_indented_lte_matcher = parser_with_context!(line_indented_lte)(context);
|
let line_indented_lte_matcher = parser_with_context!(line_indented_lte)(context);
|
||||||
alt((
|
alt((
|
||||||
recognize(tuple((line_ending, plain_list_item_matcher))),
|
recognize(plain_list_item_matcher),
|
||||||
recognize(tuple((line_ending, line_indented_lte_matcher))),
|
recognize(line_indented_lte_matcher),
|
||||||
eof,
|
eof,
|
||||||
))(input)
|
))(input)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user