diff --git a/src/parser/entity.rs b/src/parser/entity.rs index 8e20f6b..022545d 100644 --- a/src/parser/entity.rs +++ b/src/parser/entity.rs @@ -5,6 +5,7 @@ use nom::combinator::eof; use nom::combinator::map; use nom::combinator::peek; use nom::combinator::recognize; +use nom::combinator::verify; use nom::sequence::tuple; use super::org_source::OrgSource; @@ -53,7 +54,7 @@ fn name<'b, 'g, 'r, 's>( let result = tuple(( tag::<_, _, CustomError<_>>(entity.name), alt(( - map(tag("{}"), |_| true), + verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(" ")), map(peek(recognize(entity_end)), |_| false), )), ))(input);