Cleanup.
This commit is contained in:
parent
bc9bd4f97b
commit
50d2831081
@ -22,6 +22,7 @@ use super::org_source::BracketDepth;
|
|||||||
use super::org_source::OrgSource;
|
use super::org_source::OrgSource;
|
||||||
use super::util::get_consumed;
|
use super::util::get_consumed;
|
||||||
use super::util::maybe_consume_trailing_whitespace_if_not_exiting;
|
use super::util::maybe_consume_trailing_whitespace_if_not_exiting;
|
||||||
|
use super::util::org_line_ending;
|
||||||
use crate::context::bind_context;
|
use crate::context::bind_context;
|
||||||
use crate::context::parser_with_context;
|
use crate::context::parser_with_context;
|
||||||
use crate::context::RefContext;
|
use crate::context::RefContext;
|
||||||
@ -50,9 +51,7 @@ fn _filtered_keyword<'s, F: Fn(OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s
|
|||||||
// TODO: When key is a member of org-element-parsed-keywords, value can contain the standard set objects, excluding footnote references.
|
// 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, _))) =
|
let (remaining, (consumed_input, (_, _, parsed_key, _))) =
|
||||||
consumed(tuple((space0, tag("#+"), key_parser, tag(":"))))(input)?;
|
consumed(tuple((space0, tag("#+"), key_parser, tag(":"))))(input)?;
|
||||||
if let Ok((remaining, _)) =
|
if let Ok((remaining, _)) = tuple((space0::<_, CustomError>, org_line_ending))(remaining) {
|
||||||
tuple((space0::<_, CustomError>, alt((line_ending, eof))))(remaining)
|
|
||||||
{
|
|
||||||
return Ok((
|
return Ok((
|
||||||
remaining,
|
remaining,
|
||||||
Keyword {
|
Keyword {
|
||||||
@ -64,11 +63,9 @@ fn _filtered_keyword<'s, F: Fn(OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
let (remaining, _ws) = space0(remaining)?;
|
let (remaining, _ws) = space0(remaining)?;
|
||||||
let (remaining, parsed_value) = recognize(many_till(
|
let (remaining, parsed_value) =
|
||||||
anychar,
|
recognize(many_till(anychar, peek(tuple((space0, org_line_ending)))))(remaining)?;
|
||||||
peek(tuple((space0, alt((line_ending, eof))))),
|
let (remaining, _ws) = tuple((space0, org_line_ending))(remaining)?;
|
||||||
))(remaining)?;
|
|
||||||
let (remaining, _ws) = tuple((space0, alt((line_ending, eof))))(remaining)?;
|
|
||||||
Ok((
|
Ok((
|
||||||
remaining,
|
remaining,
|
||||||
Keyword {
|
Keyword {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user