Trim the trailing space off keywords with values.
All checks were successful
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded

This commit is contained in:
Tom Alexander
2023-09-04 22:15:43 -04:00
parent 1c142b68c6
commit b0392ad6fb
4 changed files with 14 additions and 10 deletions

View File

@@ -49,7 +49,11 @@ fn _filtered_keyword<'s, F: Matcher>(
// TODO: When key is a member of org-element-parsed-keywords, value can contain the standard set objects, excluding footnote references.
let (remaining, (consumed_input, (_, _, parsed_key, _))) =
consumed(tuple((space0, tag("#+"), key_parser, tag(":"))))(input)?;
match tuple((space0, alt((line_ending, eof))))(remaining) {
match tuple((
space0::<OrgSource<'_>, CustomError<OrgSource<'_>>>,
alt((line_ending, eof)),
))(remaining)
{
Ok((remaining, _)) => {
return Ok((
remaining,
@@ -60,10 +64,13 @@ fn _filtered_keyword<'s, F: Matcher>(
},
));
}
err @ Err(_) => err?,
Err(_) => {}
};
let (remaining, _ws) = space1(remaining)?;
let (remaining, parsed_value) = is_not("\r\n")(remaining)?;
let (remaining, parsed_value) = recognize(many_till(
anychar,
peek(tuple((space0, alt((line_ending, eof))))),
))(remaining)?;
let (remaining, _ws) = tuple((space0, alt((line_ending, eof))))(remaining)?;
Ok((
remaining,