diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index 1188a30..141c295 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -38,6 +38,7 @@ use crate::error::CustomError; use crate::error::MyError; use crate::error::Res; use crate::parser::macros::ak_element; +use crate::parser::macros::element; use crate::parser::table::org_mode_table; use crate::types::Element; @@ -98,7 +99,8 @@ fn _element<'b, 'g, 'r, 's>( Element::FootnoteDefinition ); - let comment_matcher = parser_with_context!(comment)(context); + element!(comment, context, input, Element::Comment); + let drawer_matcher = parser_with_context!(drawer)(context); let table_matcher = parser_with_context!(org_mode_table)(context); let verse_block_matcher = parser_with_context!(verse_block)(context); @@ -121,7 +123,6 @@ fn _element<'b, 'g, 'r, 's>( let _enter = span.enter(); opt(alt(( - map(comment_matcher, Element::Comment), map(drawer_matcher, Element::Drawer), map(table_matcher, Element::Table), map(verse_block_matcher, Element::VerseBlock),