Set is_footnote_section during parsing.
This commit is contained in:
parent
de5788d8f3
commit
270ba53150
@ -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<OrgSource<'s>>,
|
||||
title: Vec<Object<'s>>,
|
||||
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,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user