Remove unnecessary context from some util functions.
This commit is contained in:
@@ -108,7 +108,7 @@ pub fn plain_list_item<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, PlainListItem<'s>> {
|
||||
start_of_line(context, input)?;
|
||||
start_of_line(input)?;
|
||||
let (remaining, leading_whitespace) = space0(input)?;
|
||||
// It is fine that we get the indent level using the number of bytes rather than the number of characters because nom's space0 only matches space and tab (0x20 and 0x09)
|
||||
let indent_level = leading_whitespace.len();
|
||||
@@ -186,9 +186,8 @@ fn plain_list_end<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let start_of_line_matcher = parser_with_context!(start_of_line)(context);
|
||||
recognize(tuple((
|
||||
start_of_line_matcher,
|
||||
start_of_line,
|
||||
verify(many1(blank_line), |lines: &Vec<OrgSource<'_>>| {
|
||||
lines.len() >= 2
|
||||
}),
|
||||
@@ -200,7 +199,7 @@ fn plain_list_item_end<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
start_of_line(context, input)?;
|
||||
start_of_line(input)?;
|
||||
recognize(tuple((
|
||||
opt(blank_line),
|
||||
parser_with_context!(line_indented_lte)(context),
|
||||
|
||||
Reference in New Issue
Block a user