Create a template for new element functions that will take in the affiliated keywords instead of re-parsing them multiple times.
This commit is contained in:
@@ -2,6 +2,7 @@ use nom::branch::alt;
|
||||
use nom::combinator::map;
|
||||
use nom::combinator::opt;
|
||||
use nom::combinator::peek;
|
||||
use nom::multi::many0;
|
||||
use nom::sequence::tuple;
|
||||
#[cfg(feature = "tracing")]
|
||||
use tracing::span;
|
||||
@@ -59,6 +60,8 @@ fn _element<'b, 'g, 'r, 's>(
|
||||
input: OrgSource<'s>,
|
||||
can_be_paragraph: bool,
|
||||
) -> Res<OrgSource<'s>, Element<'s>> {
|
||||
let (post_affiliated_keywords_input, affiliated_keywords) = many0(affiliated_keyword)(input)?;
|
||||
|
||||
let plain_list_matcher = parser_with_context!(plain_list)(context);
|
||||
let greater_block_matcher = parser_with_context!(greater_block)(context);
|
||||
let dynamic_block_matcher = parser_with_context!(dynamic_block)(context);
|
||||
|
||||
Reference in New Issue
Block a user