Trim the trailing space off keywords with values.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user