Add check for name on paragraph.

This commit is contained in:
Tom Alexander
2023-10-04 19:56:39 -04:00
parent 057c8a1387
commit a26640355c
5 changed files with 26 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
use nom::branch::alt;
use nom::combinator::map;
use nom::combinator::not;
use nom::multi::many0;
use nom::sequence::tuple;
use super::clock::clock;
use super::comment::comment;
@@ -98,7 +100,13 @@ fn _element<'b, 'g, 'r, 's>(
map(horizontal_rule_matcher, Element::HorizontalRule),
map(latex_environment_matcher, Element::LatexEnvironment),
map(babel_keyword_matcher, Element::BabelCall),
map(keyword_matcher, Element::Keyword),
map(
map(
tuple((not(affiliated_keyword_matcher), keyword_matcher)),
|(_, kw)| kw,
),
Element::Keyword,
),
))(remaining)
{
the_ok @ Ok(_) => the_ok,