diff --git a/src/parser/headline.rs b/src/parser/headline.rs index 6b51f2b..753c72d 100644 --- a/src/parser/headline.rs +++ b/src/parser/headline.rs @@ -93,7 +93,7 @@ fn _heading<'b, 'g, 'r, 's>( children, is_comment: pre_headline.comment.is_some(), is_archived, - is_footnote_section: false, // TODO + is_footnote_section: pre_headline.is_footnote_section, }, )) } @@ -115,6 +115,7 @@ struct PreHeadline<'s> { comment: Option>, title: Vec>, tags: Vec<&'s str>, + is_footnote_section: bool, } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] @@ -163,6 +164,14 @@ fn headline<'b, 'g, 'r, 's>( let (remaining, _) = tuple((space0, org_line_ending))(remaining)?; + let is_footnote_section = maybe_title + .as_ref() + .map(|(_, (raw_title, _))| raw_title) + .map(|raw_title| { + Into::<&str>::into(raw_title) == context.get_global_settings().footnote_section + }) + .unwrap_or(false); + Ok(( remaining, PreHeadline { @@ -181,6 +190,7 @@ fn headline<'b, 'g, 'r, 's>( .collect() }) .unwrap_or(Vec::new()), + is_footnote_section, }, )) }