Store the affiliated keywords on the plainlist.

This commit is contained in:
Tom Alexander 2023-10-10 18:10:34 -04:00
parent d550966516
commit 6e39029f91
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 4 additions and 1 deletions

View File

@ -159,11 +159,13 @@ pub(crate) fn plain_list<'b, 'g, 'r, 's>(
let (remaining, _trailing_ws) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
let name = get_name(&affiliated_keywords);
Ok((
remaining,
PlainList {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords,
name,
list_type: first_item_list_type.expect("Plain lists require at least one element."),
children: children.into_iter().map(|(_start, item)| item).collect(),
},

View File

@ -7,6 +7,7 @@ use super::StandardProperties;
#[derive(Debug)]
pub struct PlainList<'s> {
pub source: &'s str,
pub affiliated_keywords: Vec<Keyword<'s>>,
pub name: Option<&'s str>,
pub list_type: PlainListType,
pub children: Vec<PlainListItem<'s>>,