It actually worked on trailing whitespace ownership test case 2.
This commit is contained in:
parent
47408763e5
commit
364ba79517
@ -229,20 +229,20 @@ fn plain_list_item<'b, 'g, 'r, 's>(
|
||||
|
||||
let exit_matcher = plain_list_item_end(indent_level);
|
||||
let final_item_whitespace_cutoff = final_item_whitespace_cutoff(indent_level);
|
||||
let final_whitespace_context = ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
exit_matcher: &final_item_whitespace_cutoff,
|
||||
});
|
||||
let final_whitespace_context = context.with_additional_node(&final_whitespace_context);
|
||||
let contexts = [
|
||||
ContextElement::ConsumeTrailingWhitespace(true),
|
||||
ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
exit_matcher: &exit_matcher,
|
||||
}),
|
||||
ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
exit_matcher: &final_item_whitespace_cutoff,
|
||||
}),
|
||||
];
|
||||
let parser_context = context.with_additional_node(&contexts[0]);
|
||||
let parser_context = final_whitespace_context.with_additional_node(&contexts[0]);
|
||||
let parser_context = parser_context.with_additional_node(&contexts[1]);
|
||||
let parser_context = parser_context.with_additional_node(&contexts[2]);
|
||||
|
||||
let maybe_contentless_item: Res<OrgSource<'_>, ()> =
|
||||
detect_contentless_item_contents(&parser_context, remaining);
|
||||
@ -283,8 +283,9 @@ fn plain_list_item<'b, 'g, 'r, 's>(
|
||||
bind_context!(exit_matcher_parser, &parser_context),
|
||||
)(remaining)?;
|
||||
|
||||
// We have to use the parser_context here to include the whitespace cut-off
|
||||
let (remaining, _trailing_ws) =
|
||||
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
maybe_consume_trailing_whitespace_if_not_exiting(&final_whitespace_context, remaining)?;
|
||||
|
||||
let source = get_consumed(input, remaining);
|
||||
return Ok((
|
||||
|
Loading…
x
Reference in New Issue
Block a user