Record element start events and report them when the event_count feature is enabled.

This commit is contained in:
Tom Alexander
2023-10-17 13:32:01 -04:00
parent 17db05c2c7
commit a2f53361eb
7 changed files with 70 additions and 1 deletions

View File

@@ -27,6 +27,10 @@ use super::table::detect_table;
use crate::context::RefContext;
use crate::error::CustomError;
use crate::error::Res;
#[cfg(feature = "event_count")]
use crate::event_count::record_event;
#[cfg(feature = "event_count")]
use crate::event_count::EventType;
use crate::parser::affiliated_keyword::affiliated_keywords;
use crate::parser::macros::ak_element;
use crate::parser::macros::element;
@@ -51,6 +55,8 @@ fn _element<'b, 'g, 'r, 's>(
input: OrgSource<'s>,
can_be_paragraph: bool,
) -> Res<OrgSource<'s>, Element<'s>> {
#[cfg(feature = "event_count")]
record_event(EventType::ElementStart, input);
let (post_affiliated_keywords_input, affiliated_keywords) =
affiliated_keywords(context, input)?;