Take into account the source directory when parsing org-mode in Organic.
Previously only the emacs code was doing this.
This commit is contained in:
@@ -47,14 +47,24 @@ fn _filtered_keyword<'s, F: Matcher>(
|
||||
) -> Res<OrgSource<'s>, Keyword<'s>> {
|
||||
start_of_line(input)?;
|
||||
// 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, _, parsed_value, _))) = consumed(tuple((
|
||||
space0,
|
||||
tag("#+"),
|
||||
key_parser,
|
||||
tag(":"),
|
||||
alt((recognize(tuple((space1, is_not("\r\n")))), space0)),
|
||||
alt((line_ending, eof)),
|
||||
)))(input)?;
|
||||
let (remaining, (consumed_input, (_, _, parsed_key, _))) =
|
||||
consumed(tuple((space0, tag("#+"), key_parser, tag(":"))))(input)?;
|
||||
match tuple((space0, alt((line_ending, eof))))(remaining) {
|
||||
Ok((remaining, _)) => {
|
||||
return Ok((
|
||||
remaining,
|
||||
Keyword {
|
||||
source: consumed_input.into(),
|
||||
key: parsed_key.into(),
|
||||
value: "".into(),
|
||||
},
|
||||
));
|
||||
}
|
||||
err @ Err(_) => err?,
|
||||
};
|
||||
let (remaining, _ws) = space1(remaining)?;
|
||||
let (remaining, parsed_value) = is_not("\r\n")(remaining)?;
|
||||
let (remaining, _ws) = tuple((space0, alt((line_ending, eof))))(remaining)?;
|
||||
Ok((
|
||||
remaining,
|
||||
Keyword {
|
||||
|
||||
Reference in New Issue
Block a user