Do not consume trailing whitespace on the footnote definition's final element.

This commit is contained in:
Tom Alexander
2023-09-08 21:30:03 -04:00
parent 6a1bdd5fee
commit 21c60d1036
3 changed files with 29 additions and 16 deletions

View File

@@ -19,6 +19,7 @@ use nom::sequence::tuple;
use super::element_parser::element;
use super::object_parser::standard_set_object;
use super::org_source::OrgSource;
use super::util::include_input;
use super::util::non_whitespace_character;
use crate::context::parser_with_context;
use crate::context::ContextElement;
@@ -225,18 +226,6 @@ pub fn plain_list_item<'b, 'g, 'r, 's>(
));
}
fn include_input<'s, F, O>(
mut inner: F,
) -> impl FnMut(OrgSource<'s>) -> Res<OrgSource<'s>, (OrgSource<'s>, O)>
where
F: FnMut(OrgSource<'s>) -> Res<OrgSource<'s>, O>,
{
move |input: OrgSource<'_>| {
let (remaining, output) = inner(input)?;
Ok((remaining, (input, output)))
}
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn bullet<'s>(i: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
alt((