Allow empty keywords.

This commit is contained in:
Tom Alexander 2023-04-21 22:44:13 -04:00
parent ec80e1a0e0
commit ee126d2673
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ use organic::parser::sexp::sexp_with_padding;
fn is_expect_fail(name: &str) -> Option<&str> {
match name {
"drawer_drawer_with_headline_inside" => Some("Apparently lines with :end: become their own paragraph. This odd behavior needs to be investigated more."),
"element_container_priority_drawer_dynamic_block" => Some("Keyword needs to be implemented."),
// "element_container_priority_drawer_dynamic_block" => Some("Keyword needs to be implemented."),
"element_container_priority_dynamic_block_dynamic_block" => Some("Keyword needs to be implemented."),
"element_container_priority_footnote_definition_dynamic_block" => Some("Keyword needs to be implemented."),
"element_container_priority_greater_block_dynamic_block" => Some("Keyword needs to be implemented."),

View File

@ -5,6 +5,7 @@ use nom::character::complete::line_ending;
use nom::character::complete::space0;
use nom::character::complete::space1;
use nom::combinator::eof;
use nom::combinator::opt;
use nom::combinator::recognize;
use nom::sequence::tuple;
@ -22,8 +23,7 @@ pub fn keyword<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str,
tag("#+"),
is_not(" \t\r\n:"),
tag(":"),
space1,
is_not("\r\n"),
alt((recognize(tuple((space1, is_not("\r\n")))), space0)),
alt((line_ending, eof)),
)))(input)?;
Ok((remaining, Keyword { source: rule }))