Handle headlines with trailing spaces without tags.

This commit is contained in:
Tom Alexander 2023-09-14 02:43:40 -04:00
parent 32b19d68d0
commit 87941271a4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 3 additions and 5 deletions

View File

@ -1,10 +1,7 @@
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::anychar;
use nom::character::complete::line_ending;
use nom::character::complete::space0;
use nom::character::complete::space1;
use nom::combinator::eof;
use nom::combinator::map;
use nom::combinator::not;
use nom::combinator::opt;
@ -184,8 +181,9 @@ fn headline_title_end<'b, 'g, 'r, 's>(
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
recognize(tuple((
opt(tuple((space0, tags, space0))),
alt((line_ending, eof)),
org_spaces0,
opt(tuple((tags, org_spaces0))),
org_line_ending,
)))(input)
}