Handle spaces after statistics cookies.
This commit is contained in:
parent
352c20d1d8
commit
0d7a15bfeb
@ -0,0 +1 @@
|
||||
* [0/4] foo
|
@ -4,6 +4,7 @@ use nom::combinator::recognize;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
use super::org_source::OrgSource;
|
||||
use super::util::get_consumed;
|
||||
use super::util::maybe_consume_object_trailing_whitespace_if_not_exiting;
|
||||
use crate::context::parser_with_context;
|
||||
use crate::context::RefContext;
|
||||
@ -26,10 +27,11 @@ pub fn percent_statistics_cookie<'b, 'g, 'r, 's>(
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, StatisticsCookie<'s>> {
|
||||
let (remaining, source) =
|
||||
let (remaining, _) =
|
||||
recognize(tuple((tag("["), nom::character::complete::u64, tag("%]"))))(input)?;
|
||||
let (remaining, _trailing_whitespace) =
|
||||
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
Ok((
|
||||
remaining,
|
||||
StatisticsCookie {
|
||||
@ -43,7 +45,7 @@ pub fn fraction_statistics_cookie<'b, 'g, 'r, 's>(
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, StatisticsCookie<'s>> {
|
||||
let (remaining, source) = recognize(tuple((
|
||||
let (remaining, _) = recognize(tuple((
|
||||
tag("["),
|
||||
nom::character::complete::u64,
|
||||
tag("/"),
|
||||
@ -52,6 +54,7 @@ pub fn fraction_statistics_cookie<'b, 'g, 'r, 's>(
|
||||
)))(input)?;
|
||||
let (remaining, _trailing_whitespace) =
|
||||
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
Ok((
|
||||
remaining,
|
||||
StatisticsCookie {
|
||||
|
Loading…
Reference in New Issue
Block a user