Implement the new fields for footnote definitions.

This commit is contained in:
Tom Alexander
2023-10-31 23:12:04 -04:00
parent 281c35677b
commit 70002800c2
2 changed files with 13 additions and 3 deletions

View File

@@ -75,6 +75,7 @@ where
let parser_context = parser_context.with_additional_node(&contexts[2]);
let element_matcher = parser_with_context!(element(true))(&parser_context);
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
let before_contents = remaining;
let (mut remaining, (mut children, _exit_contents)) =
many_till(include_input(element_matcher), exit_matcher)(remaining)?;
@@ -90,13 +91,16 @@ where
}
}
let (remaining, _trailing_ws) =
let contents = get_consumed(before_contents, remaining);
let (remaining, post_blank) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
Ok((
remaining,
FootnoteDefinition {
source: source.into(),
contents: Some(contents.into()),
post_blank: post_blank.map(Into::<&str>::into),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,