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

@@ -211,3 +211,15 @@ pub fn text_until_eol<'r, 's>(
.map(|(_remaining, line)| Into::<&str>::into(line))?;
Ok(line.trim())
}
pub 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)))
}
}